Opened 6 years ago
Closed 6 years ago
#2018 closed defect (fixed)
Test web interface on Centos 7 should capture image error if elements not found
Reported by: | Bang Pham Huu | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 9.8 |
Component: | systemtest | Version: | 9.7 |
Keywords: | Cc: | Dimitar Misev | |
Complexity: | Medium |
Description
This happens randomly when Selenium cannot find an HTML to click on. However, it should capture the current screen in case of error to know what is missing instead of throwing an exception and stopping the test.
The test process failed with an unexpected exception '{"errorMessage":"Unable to find element with xpath '/html/body/div/div/div/div/div/div[1]/div/ul/div/div/ul/li[4]/a'","request":{"headers":{"Accept-Encoding":"gzip,deflate","Connection":"Keep-Alive","Content-Length":"91","Content-Type":"application/json; charset=utf-8","Host":"localhost:17959","User-Agent":"Apache-HttpClient/4.3.4 (java 1.5)"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"xpath\",\"value\":\"/html/body/div/div/div/div/div/div[1]/div/ul/div/div/ul/li[4]/a\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/7e230870-3f66-11e9-a1d3-eb220c0a7e63/element"}} Command duration or timeout: 1.06 seconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.1.3.el7.x86_64', java.version: '1.8.0_191' Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, handlesAlerts=false, databaseEnabled=false, version=2.1.1, platform=LINUX, browserConnectionEnabled=false, proxy={proxyType=direct}, nativeEvents=true, acceptSslCerts=false, driverVersion=1.2.0, locationContextEnabled=false, webStorageEnabled=false, browserName=phantomjs, takesScreenshot=true, driverName=ghostdriver, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 7e230870-3f66-11e9-a1d3-eb220c0a7e63'. org.openqa.selenium.NoSuchElementException: {"errorMessage":"Unable to find element with xpath '/html/body/div/div/div/div/div/div[1]/div/ul/div/div/ul/li[4]/a'","request":{"headers":{"Accept-Encoding":"gzip,deflate","Connection":"Keep-Alive","Content-Length":"91","Content-Type":"application/json; charset=utf-8","Host":"localhost:17959","User-Agent":"Apache-HttpClient/4.3.4 (java 1.5)"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"xpath\",\"value\":\"/html/body/div/div/div/div/div/div[1]/div/ul/div/div/ul/li[4]/a\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/7e230870-3f66-11e9-a1d3-eb220c0a7e63/element"}} Command duration or timeout: 1.06 seconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'localhost.localdomain', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.1.3.el7.x86_64', java.version: '1.8.0_191' Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, handlesAlerts=false, databaseEnabled=false, version=2.1.1, platform=LINUX, browserConnectionEnabled=false, proxy={proxyType=direct}, nativeEvents=true, acceptSslCerts=false, driverVersion=1.2.0, locationContextEnabled=false, webStorageEnabled=false, browserName=phantomjs, takesScreenshot=true, driverName=ghostdriver, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 7e230870-3f66-11e9-a1d3-eb220c0a7e63 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352) at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:449) at org.openqa.selenium.By$ByXPath.findElement(By.java:357) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344) at org.rasdaman.AbstractWebPageTest.clickOnElement(AbstractWebPageTest.java:156) at org.rasdaman.AbstractWebPageTest.runTestByClickingOnElement(AbstractWebPageTest.java:188) at org.rasdaman.ws_client.WCSProcessCoverageTest.runTest(WCSProcessCoverageTest.java:62) at org.rasdaman.Application.main(Application.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Note:
See TracTickets
for help on using tickets.