Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Problems with xpath and selenium
Joined: Jul 24, 2013
Jul 26, 2013 06:15:48
Hello, good morning. I'm using XPath to find an attribute of a field and be able to change this attribute.
For example, I have the last name and this field has the value Dias. I want to put another name.
This command in selenium
selenium.type ("/ / div [() =" datos "* / text] de entrada / descendant :: [@ name = 'nombre'] "," Roberts ");
Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Invalid xpath : XPath parse error // Div [* /text () = 'dados'] / descendente :: input [ @ name ='sobrenome']: // Step [ RelativeLocationPath / Expr ] /
Thanks for the help
Joined: Sep 10, 2013
Sep 15, 2013 11:30:54
What is datos? Is that a
variable? If so, then you want to build the string with the + sign like this:
selenium.type ("/ / div [() =" + datos + "* / text] de entrada / descendant :: [@ name = 'nombre'] "," Roberts ");
It is sorta covered in the
JavaRanch Style Guide
subject: Problems with xpath and selenium
Java XHTML DOM: Exception in getElementById with XPath
java.lang.NoClassDefFoundError: org/dom4j/DocumentException - error encontered
Junit4+Eclipse+Selenium RC- Test class should have exactly one public zero-argument constructor
Script for an email address that is already registered in the database
selenium code for ahref
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014