SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

xpath with src not working selenium-server-standalone-2.53.1.jar #8855

Closed manishsewlikar closed 6 years ago

manishsewlikar commented 6 years ago

WebElement row32= row12.findElement(By.xpath("//img[contains(@src,'https://sitvfcpq.bigmachines.com/gwt/Migration/clear.cache.gif')])["+imgclick+"]")); is not working with selenium-server-standalone-2.53.1.jar excpetion is Exception in thread "main" org.openqa.selenium.InvalidSelectorException: The given selector //img[contains(@src,'https://sitvfcpq.bigmachines.com/gwt/Migration/clear.cache.gif')])[27] is either invalid or does not result in a WebElement. The following error occurred: InvalidSelectorError: Unable to locate an element with the xpath expression //img[contains(@src,'https://sitvfcpq.bigmachines.com/gwt/Migration/clear.cache.gif')])[27] because of the following error: SyntaxError: The expression is not a legal expression. Command duration or timeout: 47 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/invalid_selector_exception.html Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03' System info: host: 'INPUSCLP04582', ip: '10.10.209.153', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_66' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=43.0.1, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 6aa8019e-22a4-4b4e-8ce6-9f61d3e9dcde *** Element info: {Using=xpath, value=//img[contains(@src,'https://sitvfcpq.bigmachines.com/gwt/Migration/clear.cache.gif')])[27]} 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:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327) at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:198) at org.openqa.selenium.remote.RemoteWebElement.findElementByXPath(RemoteWebElement.java:295) at org.openqa.selenium.By$ByXPath.findElement(By.java:361) at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:194) at com.vf.poc.cpq.CPQEmailDesign.main(CPQEmailDesign.java:231) Caused by: org.openqa.selenium.InvalidSelectorException: The given selector //img[contains(@src,'https://sitvfcpq.bigmachines.com/gwt/Migration/clear.cache.gif')])[27] is either invalid or does not result in a WebElement. The following error occurred: InvalidSelectorError: Unable to locate an element with the xpath expression //img[contains(@src,'https://sitvfcpq.bigmachines.com/gwt/Migration/clear.cache.gif')])[27] because of the following error: SyntaxError: The expression is not a legal expression. For documentation on this error, please visit: http://seleniumhq.org/exceptions/invalid_selector_exception.html Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03' System info: host: 'INPUSCLP04582', ip: '10.10.209.153', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.066' Driver info: driver.version: unknown at .FirefoxDriver.annotateInvalidSelectorError(file:///C:/Users/MS0038~1/AppData/Local/Temp/anonymous5901198011137788620webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10744) at .FirefoxDriver.prototype.findElementInternal(file:///C:/Users/MS0038~1/AppData/Local/Temp/anonymous5901198011137788620webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10775) at .FirefoxDriver.prototype.findChildElement(file:///C:/Users/MS0038~1/AppData/Local/Temp/anonymous5901198011137788620webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10782) at .DelayedCommand.prototype.executeInternal/h(file:///C:/Users/MS0038~1/AppData/Local/Temp/anonymous5901198011137788620webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12661) at .DelayedCommand.prototype.executeInternal_(file:///C:/Users/MS0038~1/AppData/Local/Temp/anonymous5901198011137788620webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12666) at .DelayedCommand.prototype.execute/<(file:///C:/Users/MS0038~1/AppData/Local/Temp/anonymous5901198011137788620webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12608)