Java question really.
You will need to show us the code for isElementPresent and the value of text that you are passing in.
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
That just gives me more questions.
Is the the code bloc of isElementPresent? (I’m expecting to see the declaration of the function as well as the code)
What is:
· The code for findElementWrapper()
· The code for getWebElement()
· locatorObj (it looks like and object)
· pollingTime (it doesn’t seem to be defined)
I would guess that at some point you need to do something along the lines of:
locator = locator.replaceAll("'", "\\'");
It’s a real shot in the dark at the moment though.
I’m pretty sure it’s going wrong inside locatorObj, which is where you should be doing the replaceAll.
Can you show the code for locatorObj.
Have you tried with \\” ? in java you need to escape the \
From: webd...@googlegroups.com [mailto:webd...@googlegroups.com] On Behalf Of Adrian Marton
Sent: 01 August 2012 09:44
To: webd...@googlegroups.com
Subject: [webdriver] Re: [WebDriver] cannot verify text present if the content contains special characters
Hello,
I have the same problem.If you try to find an element by xpath and the text contains quotes then it will fail.I've tried to replace the \" with his ascii code, or special characte like   but it's not working.
text= "a\"b";
test.findElement(By.xpath(text));// will fail
This is a normal behavior because you can do something like this:
test.findElement(By.xpath("./option[@text()=\" + value + "\"]")) and it will work fine if the value variable doesn't contain any special characters, but if for example value contains \" then By.xpath will not
interpret the expression correctly.
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/CiqVbjJ_4RsJ.
[Exception... "The expression is not a legal expression." code: "51" nsresult: "0x805b0033 (NS_ERROR_DOM_INVALID_EXPRESSION_ERR)" location: "file:///C:/Users/jshen/AppData/Local/Temp/anonymous4442777811371808560webdriver-profile/extensions/fxdri...@googlecode.com/components/driver_component.js Line: 2438"]
Command duration or timeout: 100 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/invalid_selector_exception.html
Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:38'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_33'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:175)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:459)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:316)
at org.openqa.selenium.By$ByXPath.findElements(By.java:339)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:215)
anyone can help take a look?
selenium version. 2.21.
Thanks,
-Shen
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/CiqVbjJ_4RsJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
The latest version is 2.25.0, you are very out of date.
Have a look at the fixes and additions since 2.15.0 here: