brandizzi / golem

https://bitbucket.org/brandizzi/golem/wiki/Home
0 stars 0 forks source link

Support class and name queries #4

Open brandizzi opened 9 years ago

brandizzi commented 9 years ago

Original report by Adam Victor Brandizzi (Bitbucket: brandizzi, GitHub: brandizzi).


The fill() method only receives selectors for now, but we really need to receive other queries - most notably, name (for inputs) and class (for other elements):

animator.fill(name='username', value='juju')
animator.fill(class='message', value='Is it an error message?')
brandizzi commented 9 years ago

Original comment by Adam Victor Brandizzi (Bitbucket: brandizzi, GitHub: brandizzi).


Other natural option is XPath

animator.fill(xpath="//form[@method='/']//input[@name='username']", value='value')

and a very interesting one can be to find by labels...

animator.fill(label='Enter your name here', value='Juju')

although this one is much more complicated.