APW Internal

class tir.technologies.apw_internal.ApwInternal(config_path='')
CheckBrowse(valores)

Verify if a value exists in the browse

Method to check if a link is valid

Click(element)

Execute a click in a button

Method to click in a link

ClickMenu(caminho)

Method to click in a option on the menu

CloseAlert()

Method to close an alert

CloseWindow()

Method to close a window

EndCase()

Method to end the testcase

SearchValue(busca, valor, grid=False, btnOk='ok', btnFind='buscar', searchparam='Pesquisar')

Searches for a register

SelectBrowse(valores, opcao='', duplo=True)

Method to select a option in a browse

SetButton(button, type='')

Method that clicks on a button of the interface.

SetComboBox(Id, cText)

Selects a value in a combobox

SetGrid(btnFunc='Incluir')

Method to send values to a grid

SetValue(campo, valor, grid=False, linha=0, chknewline=False, disabled=False)

Includes values in a field

Setup(lblUser='Usuário', lblPassword='Senha', btnAccess='Acessar Portal')

Fills the login screen

SwitchModal(option, frame='')

Sets the focus in a modal object

SwitchWindow(exit=False)

Sets the focus in the active window

WaitModal(text, opcao='title')

Waits for a modal object with a value on title

check_mask(element)

Checks wether the element has a numeric mask.

create_message(args, messageType=<MessageType.CORRECT: 1>)

Returns default messages used all throughout the class.

find_label_element(label_text, container)

[Internal]

Find input element next to label containing the label_text parameter.

Parameters
  • label_text (string) – The label text to be searched

  • container (BeautifulSoup object) – The main container object to be used

Returns

A list containing a BeautifulSoup object next to the label

Return type

List of BeautifulSoup objects

Usage:

>>> self.find_label_element("User:", container_object)
get_web_value(element)

Gets the informations of field based in the ID

input_value(field, value, ignore_case=True)

[Internal] [returns Bool] Sets a value in an input element. Returns True if succeeded, False if it failed.

remove_mask(string)

Removes special characters from received string.

send_keys(element, arg)

[Internal]

Clicks two times on the Selenium element.

Parameters
  • element (Selenium object) – Selenium element

  • arg (string or selenium.webdriver.common.keys) – Text or Keys to be sent to the element

Usage:

>>> #Defining the element:
>>> element = lambda: self.driver.find_element_by_id("example_id")
>>> #Calling the method with a string
>>> self.send_keys(element(), "Text")
>>> #Calling the method with a Key
>>> self.send_keys(element(), Keys.ENTER)
wait_elements_load(noElement, type='', frames='')

Waits until a element to be present