Skip to content

Instantly share code, notes, and snippets.

@wellavelino
Created November 8, 2017 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wellavelino/51253391cf1ef993c7485f0b0a44951d to your computer and use it in GitHub Desktop.
Save wellavelino/51253391cf1ef993c7485f0b0a44951d to your computer and use it in GitHub Desktop.
commands to inspect elements

Appium commands

driver.rotate :landscape

driver.rotate :portrait

find_element(id:'title').text = retorna o texto do elemento

find_element(id:'title').name = retorna o texto do elemento

find_element(id:'title') = busca o elemento

find_element(id:'showInvisible').click = encontra o elemento e toca nele

find_element(id:'showInvisible').clear = limpa o campo

find_element(id:'showInvisible').tag_name = verifica a class do elemento

find_element(id:'showInvisible').displayed? = retorna true ou falso

find_element(id:'showInvisible').attribute('checked') = retorna true ou falso para o um checkbox

find_elements(id:'wandimito')[1] = (Wand)

start_driver = reinicia o drive

Calabash commands

query "* id:'seu id'" <= Retorna os elementos ao id correspondente

query "* marked:'texto ou id'" <= Retorna os elementos ao texto/id correspondente

query "* id:'seu id'", :text <= Retorna o texto do elemento

result = query "* id:'seu id'" <= Adiciona o resultado a uma variável

query "*", :someMethod <= Acessa um método específico como :getError

query "* {text CONTAINS[c] 'text'}" <= Retorna qualquer string que tiver o texto da query

query "* id:'seu id' index:seu index" <= Retorna o elemento pelo index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment