I’m working on a form filling software, and I was wondering how would I go about selecting a field via name attribute or even CSS selector/XPath (like in selenium) via a web browser? Instead of findbyid?
Or Selenium RC is my only option?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use XPath to select your elements.
Examples are on this page: http://wiki.openqa.org/display/SEL/Help+With+XPath
Selenium supports many different locator types. Use the “xpath=” prefix for XPath locators, except where “xpath” is already in the method name.
EDIT
To test on http://google.com
After running this command, the input box on google.com should have the word TEST written on it.