Selenium - Pegar valor Title  XML
Índice dos Fóruns » Java Básico
Autor Mensagem
surfzera
Virtual Machine Man
[Avatar]

Membro desde: 13/10/2006 12:14:37
Mensagens: 681
Offline

Pessoal alguem sabe como pegar o valor do Title de um input com selenium?
[WWW]
bezier curve
JavaEvangelist
[Avatar]
Membro desde: 28/11/2009 17:55:58
Mensagens: 411
Offline

http://release.seleniumhq.org/selenium-core/0.8.0/reference.html

Procure por "assertTitle"
jaboot
Virtual Machine Man

Membro desde: 01/07/2005 14:25:37
Mensagens: 749
Localização: São Paulo
Offline

surfzera,

Dando uma pesquisada, eu achei isso:

element.getAttribute(name)
Get the value of a the given attribute of the element. Will return the current value, even if this has been modified after the page has been loaded. More exactly, this method will return the value of the given attribute, unless that attribute is not present, in which case the value of the property with the same name is returned. If neither value is set, null is returned. The "style" attribute is converted as best can be to a text representation with a trailing semi-colon. The following are deemed to be "boolean" attributes, and will return either "true" or "false": async, autofocus, autoplay, checked, compact, complete, controls, declare, defaultchecked, defaultselected, defer, disabled, draggable, ended, formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, selected, spellcheck, truespeed, willvalidate Finally, the following commonly mis-capitalized attribute/property names are evaluated as expected:
"class"
"readonly"
Parameters:
name The name of the attribute.
Returns:
The attribute's current value or null if the value is not set.


Talvez seja só especificar o nome do atributo que você deseja que ele recebe em forma de String. Testa lá e diz se funcionou.
Senão a gente tenta pegar pelo xpath, mas é muito mais trabalhoso.
[MSN] [ICQ]
 
Índice dos Fóruns » Java Básico
Ir para:   
Powered by JForum 2.1.8 © JForum Team