• Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning Input Class from HTML Using Selenium  RSS feed

 
Peter Gray
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Folks,

This is my first Java Application.

What i am trying to do is log into my dummy trading account, find a trade based on a ticker and then return the value.

Here is what i have so far



The immediate issue I am having is using Selenium to click on the Login Button. The tag seems to be returning as a class and not an id.




I have been able to use just the findElement by id on other accounts I have, however you have to pay like £100 a year to stop being timed out every 10 seconds, so I get stuck after logging in.

iii.co.uk doesnt have a time out function so trying with this.

Any help to figure out how to access the input class above would help a lot.


The error I am getting from Selenium is:

org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"inline.faux-button.secondary"}
Command duration or timeout: 47 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:03:00'
System info: host: 'PeterGray', ip: '192.168.56.1', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_51'
Session ID: 6d39f503-e939-4c1d-b023-e27354693b59
Driver info: org.openqa.selenium.firefox.FirefoxDriver


Thanks,

Pete
 
Junilu Lacar
Sheriff
Posts: 11486
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class = "inline faux-button secondary" assigns three different classes to the element: inline, faux-button, and secondary.

OTOH, with findElementTwo("inline.faux-button.secondary", driver) you are asking Selenium to find the element with a class attribute of "inline.faux-button.secondary"
 
Peter Gray
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julinu,

Thanks for that. I can log in now

Now to take the data from it.

Pete
 
Junilu Lacar
Sheriff
Posts: 11486
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Gray wrote:Hi Julinu,

Thanks for that. I can log in now

You're welcome. BTW, it's Junilu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!