• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Returning Input Class from HTML Using Selenium

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 16631
278
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 16631
278
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic