/html/body/div[1]/div[2]/div[4]/div/div[1]/div[2]/span[2]
Hi,
Am using selenium to automate PDF verification. Am launching PDF in Firefox and using XPATH am identifying each element's text and verifying it against expected value. I could get XPATH from Firefox inspection but could not access. PFB for more details
Selenium version:
selenium-server-standalone-3.9.1
selenium-server-3.9.1
geckodriver-v0.24.0-win64
Firefox 66.0.3 (64 bit)
xpath: /html/body/div[1]/div[2]/div[4]/div/div[1]/div[2]/span[2]
Error:
1555846788724 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\User\\AppData\\Local\\Temp\\rust_mozprofile.qDB2b3DlvHFn"
1555846792579 Marionette INFO Listening on port 50319
1555846793075 Marionette WARN TLS certificate errors will be ignored for this session
Apr 21, 2019 7:39:53 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[Parent 12768, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 332
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: /html/body/div[1]/div[2]/div[4]/div/div[1]/div[2]/span[2]
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z'
System info: host: 'BALA', ip: '172.20.20.20', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_161' Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 66.0.3, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.24.0, moz:headless: false, moz:processID: 12768, moz:profile: C:\Users\User\AppData\Local..., moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 6.3, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: fb5902b1-0233-4188-a026-4650c0dcc111
*** Element info: {Using=xpath, value=/html/body/div[1]/div[2]/div[4]/div/div[1]/div[2]/span[2]}
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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:160)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:371)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363)
at ReadData.invokeBrowser_F(ReadData.java:26)
at ReadData.main(ReadData.java:37)