Updates to the Selenium WebDriver tests.

This commit is contained in:
Graham Triggs 2016-01-26 20:52:43 +00:00
parent 5053b4cff4
commit aac9373f85
55 changed files with 2224 additions and 774 deletions

View file

@ -0,0 +1,191 @@
<html>
<head>
<title>TestNG: Command line test</title>
<link href="../testng.css" rel="stylesheet" type="text/css" />
<link href="../my-testng.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.log { display: none;}
.stack-trace { display: none;}
</style>
<script type="text/javascript">
<!--
function flip(e) {
current = e.style.display;
if (current == 'block') {
e.style.display = 'none';
return 0;
}
else {
e.style.display = 'block';
return 1;
}
}
function toggleBox(szDivId, elem, msg1, msg2)
{
var res = -1; if (document.getElementById) {
res = flip(document.getElementById(szDivId));
}
else if (document.all) {
// this is the way old msie versions work
res = flip(document.all[szDivId]);
}
if(elem) {
if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
}
}
function toggleAllBoxes() {
if (document.getElementsByTagName) {
d = document.getElementsByTagName('div');
for (i = 0; i < d.length; i++) {
if (d[i].className == 'log') {
flip(d[i]);
}
}
}
}
// -->
</script>
</head>
<body>
<h2 align='center'>Command line test</h2><table border='1' align="center">
<tr>
<td>Tests passed/Failed/Skipped:</td><td>0/1/0</td>
</tr><tr>
<td>Started on:</td><td>Sat Jan 23 20:20:12 GMT 2016</td>
</tr>
<tr><td>Total time:</td><td>1 seconds (1334 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
<td>Excluded groups:</td><td></td>
</tr>
</table><p/>
<small><i>(Hover the method name to see the test class name)</i></small><p/>
<table width='100%' border='1' class='invocation-failed'>
<tr><td colspan='4' align='center'><b>FAILED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='org.vivoweb.vivo.selenium.tests.RebuildSearchIndex.rebuildSearchIndexTest()'><b>rebuildSearchIndexTest</b><br>Test class: org.vivoweb.vivo.selenium.tests.RebuildSearchIndex</td>
<td><div><pre>org.openqa.selenium.NoSuchElementException: Unable to locate element: {&quot;method&quot;:&quot;link text&quot;,&quot;selector&quot;:&quot;Site Admin&quot;}
Command duration or timeout: 1.18 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: &apos;2.48.2&apos;, revision: &apos;41bccdd10cf2c0560f637404c2d96164b67d9d67&apos;, time: &apos;2015-10-09 13:08:06&apos;
System info: host: &apos;Grahams-MBP-2&apos;, ip: &apos;192.168.1.239&apos;, os.name: &apos;Mac OS X&apos;, os.arch: &apos;x86_64&apos;, os.version: &apos;10.11.3&apos;, java.version: &apos;1.8.0_60&apos;
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=43.0.4, platform=MAC, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 0454c462-95d4-4143-85a7-404602e998cd
*** Element info: {Using=link text, value=Site Admin}
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:647)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByLinkText(RemoteWebDriver.java:418)
at org.openqa.selenium.By$ByLinkText.findElement(By.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:345)
at org.vivoweb.vivo.selenium.tests.AbstractSeleniumTest.clickAndWait(AbstractSeleniumTest.java:46)
at org.vivoweb.vivo.selenium.tests.RebuildSearchIndex.rebuildSearchIndexTest(RebuildSearchIndex.java:15)
at org.vivoweb.vivo.selenium.suites.Suite2.suite2(Suite2.java:18)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {&quot;method&quot;:&quot;link text&quot;,&quot;selector&quot;:&quot;Site Admin&quot;}
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: &apos;2.48.2&apos;, revision: &apos;41bccdd10cf2c0560f637404c2d96164b67d9d67&apos;, time: &apos;2015-10-09 13:08:06&apos;
System info: host: &apos;Grahams-MBP-2&apos;, ip: &apos;192.168.1.239&apos;, os.name: &apos;Mac OS X&apos;, os.arch: &apos;x86_64&apos;, os.version: &apos;10.11.3&apos;, java.version: &apos;1.8.0_60&apos;
Driver info: driver.version: unknown
at &lt;anonymous class&gt;.FirefoxDriver.prototype.findElementInternal_(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10659)
at &lt;anonymous class&gt;.FirefoxDriver.prototype.findElement(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10668)
at &lt;anonymous class&gt;.DelayedCommand.prototype.executeInternal_/h(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12534)
at &lt;anonymous class&gt;.DelayedCommand.prototype.executeInternal_(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12539)
at &lt;anonymous class&gt;.DelayedCommand.prototype.execute/&lt;(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12481)
... Removed 46 stack frames</pre></div><a href='#' onClick='toggleBox("stack-trace795242171", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace795242171'><pre>org.openqa.selenium.NoSuchElementException: Unable to locate element: {&quot;method&quot;:&quot;link text&quot;,&quot;selector&quot;:&quot;Site Admin&quot;}
Command duration or timeout: 1.18 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: &apos;2.48.2&apos;, revision: &apos;41bccdd10cf2c0560f637404c2d96164b67d9d67&apos;, time: &apos;2015-10-09 13:08:06&apos;
System info: host: &apos;Grahams-MBP-2&apos;, ip: &apos;192.168.1.239&apos;, os.name: &apos;Mac OS X&apos;, os.arch: &apos;x86_64&apos;, os.version: &apos;10.11.3&apos;, java.version: &apos;1.8.0_60&apos;
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=43.0.4, platform=MAC, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 0454c462-95d4-4143-85a7-404602e998cd
*** Element info: {Using=link text, value=Site Admin}
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:422)
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:647)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByLinkText(RemoteWebDriver.java:418)
at org.openqa.selenium.By$ByLinkText.findElement(By.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:345)
at org.vivoweb.vivo.selenium.tests.AbstractSeleniumTest.clickAndWait(AbstractSeleniumTest.java:46)
at org.vivoweb.vivo.selenium.tests.RebuildSearchIndex.rebuildSearchIndexTest(RebuildSearchIndex.java:15)
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:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.vivoweb.vivo.selenium.suites.Suite2.suite2(Suite2.java:18)
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:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:122)
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:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {&quot;method&quot;:&quot;link text&quot;,&quot;selector&quot;:&quot;Site Admin&quot;}
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: &apos;2.48.2&apos;, revision: &apos;41bccdd10cf2c0560f637404c2d96164b67d9d67&apos;, time: &apos;2015-10-09 13:08:06&apos;
System info: host: &apos;Grahams-MBP-2&apos;, ip: &apos;192.168.1.239&apos;, os.name: &apos;Mac OS X&apos;, os.arch: &apos;x86_64&apos;, os.version: &apos;10.11.3&apos;, java.version: &apos;1.8.0_60&apos;
Driver info: driver.version: unknown
at &lt;anonymous class&gt;.FirefoxDriver.prototype.findElementInternal_(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10659)
at &lt;anonymous class&gt;.FirefoxDriver.prototype.findElement(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10668)
at &lt;anonymous class&gt;.DelayedCommand.prototype.executeInternal_/h(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12534)
at &lt;anonymous class&gt;.DelayedCommand.prototype.executeInternal_(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12539)
at &lt;anonymous class&gt;.DelayedCommand.prototype.execute/&lt;(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12481)
</pre></div></td>
<td>1</td>
<td>org.vivoweb.vivo.selenium.tests.RebuildSearchIndex@1cf56a1c</td></tr>
</table><p>
</body>
</html>

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
<testsuite hostname="Grahams-MBP-2" name="Command line test" tests="1" failures="1" timestamp="23 Jan 2016 20:20:13 GMT" time="1.334" errors="0">
<testcase name="rebuildSearchIndexTest" time="1.191" classname="org.vivoweb.vivo.selenium.tests.RebuildSearchIndex">
<failure type="org.openqa.selenium.NoSuchElementException" message="Unable to locate element: {&amp;quot;method&amp;quot;:&amp;quot;link text&amp;quot;,&amp;quot;selector&amp;quot;:&amp;quot;Site Admin&amp;quot;}
Command duration or timeout: 1.18 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: &amp;apos;2.48.2&amp;apos;, revision: &amp;apos;41bccdd10cf2c0560f637404c2d96164b67d9d67&amp;apos;, time: &amp;apos;2015-10-09 13:08:06&amp;apos;
System info: host: &amp;apos;Grahams-MBP-2&amp;apos;, ip: &amp;apos;192.168.1.239&amp;apos;, os.name: &amp;apos;Mac OS X&amp;apos;, os.arch: &amp;apos;x86_64&amp;apos;, os.version: &amp;apos;10.11.3&amp;apos;, java.version: &amp;apos;1.8.0_60&amp;apos;
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=43.0.4, platform=MAC, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 0454c462-95d4-4143-85a7-404602e998cd
*** Element info: {Using=link text, value=Site Admin}">
<![CDATA[org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"link text","selector":"Site Admin"}
Command duration or timeout: 1.18 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'Grahams-MBP-2', ip: '192.168.1.239', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=43.0.4, platform=MAC, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 0454c462-95d4-4143-85a7-404602e998cd
*** Element info: {Using=link text, value=Site Admin}
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:647)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByLinkText(RemoteWebDriver.java:418)
at org.openqa.selenium.By$ByLinkText.findElement(By.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:345)
at org.vivoweb.vivo.selenium.tests.AbstractSeleniumTest.clickAndWait(AbstractSeleniumTest.java:46)
at org.vivoweb.vivo.selenium.tests.RebuildSearchIndex.rebuildSearchIndexTest(RebuildSearchIndex.java:15)
at org.vivoweb.vivo.selenium.suites.Suite2.suite2(Suite2.java:18)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"link text","selector":"Site Admin"}
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'Grahams-MBP-2', ip: '192.168.1.239', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.8.0_60'
Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.findElementInternal_(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10659)
at <anonymous class>.FirefoxDriver.prototype.findElement(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10668)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12534)
at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12539)
at <anonymous class>.DelayedCommand.prototype.execute/<(file:///var/folders/7d/pmw9wv8n4nz_x9t4ztp_6tgw0000gn/T/anonymous8499514178617750884webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12481)
... Removed 46 stack frames]]>
</failure>
</testcase> <!-- rebuildSearchIndexTest -->
</testsuite> <!-- Command line test -->

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Failed suite [Command line suite]">
<test name="Command line test" preserve-order="false">
<classes>
<class name="org.vivoweb.vivo.selenium.tests.RebuildSearchIndex"/>
</classes>
</test> <!-- Command line test -->
<test name="Command line test(failed)">
<classes>
<class name="org.vivoweb.vivo.selenium.tests.RebuildSearchIndex">
<methods>
<include name="cleanup"/>
<include name="rebuildSearchIndexTest"/>
<include name="vivoSetup"/>
<include name="setUp"/>
<include name="vivoTeardown"/>
<include name="setup"/>
</methods>
</class> <!-- org.vivoweb.vivo.selenium.tests.RebuildSearchIndex -->
</classes>
</test> <!-- Command line test(failed) -->
</suite> <!-- Failed suite [Command line suite] -->