Exception Translator Demo

Normally WebDriver adds debug info to the end of the exception message. The fixture for this demo adds an extension that removes this extra information. Note that the stack trace still contains the debug information (which should be included if reporting a bug on the WebDriver mailing list).

Example

Look for a non-existent elementorg.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"nonExistent"} Command duration or timeout: 78 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'testing-gce-4912bcd2-a834-4996-b186-368c0234d135.c.eco-emissary-99515.internal', ip: '10.240.0.22', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-63-generic', java.version: '1.8.0_66' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=38.4.0, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: a9bc6001-a810-4a89-9ef4-6850d0810e0a *** Element info: {Using=class name, value=nonExistent}

While evaluating expression: clickOnNonExistentLink()

org.concordion.internal.InvalidExpressionException: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"nonExistent"} Command duration or timeout: 78 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'testing-gce-4912bcd2-a834-4996-b186-368c0234d135.c.eco-emissary-99515.internal', ip: '10.240.0.22', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-63-generic', java.version: '1.8.0_66' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=38.4.0, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: a9bc6001-a810-4a89-9ef4-6850d0810e0a *** Element info: {Using=class name, value=nonExistent}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
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:678)
at org.openqa.selenium.remote.RemoteWebDriver.findElement (RemoteWebDriver.java:363)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByClassName (RemoteWebDriver.java:477)
at org.openqa.selenium.By$ByClassName.findElement (By.java:391)
at org.openqa.selenium.remote.RemoteWebDriver.findElement (RemoteWebDriver.java:355)
at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement (DefaultElementLocator.java:69)
at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke (LocatingElementHandler.java:38)
at com.sun.proxy.$Proxy14.click (Unknown Source)
at org.concordion.ext.demo.selenium.web.GoogleSearchPage.clickOnNonExistentLink (GoogleSearchPage.java:49)
at org.concordion.ext.demo.selenium.ExceptionTranslatorDemo.clickOnNonExistentLink (ExceptionTranslatorDemo.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
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 ognl.OgnlRuntime.invokeMethod (OgnlRuntime.java:872)
at ognl.OgnlRuntime.callAppropriateMethod (OgnlRuntime.java:1295)
at ognl.ObjectMethodAccessor.callMethod (ObjectMethodAccessor.java:68)
at ognl.OgnlRuntime.callMethod (OgnlRuntime.java:1371)
at ognl.ASTMethod.getValueBody (ASTMethod.java:90)
at ognl.SimpleNode.evaluateGetValueBody (SimpleNode.java:212)
at ognl.SimpleNode.getValue (SimpleNode.java:258)
at ognl.Ognl.getValue (Ognl.java:494)
at ognl.Ognl.getValue (Ognl.java:596)
at ognl.Ognl.getValue (Ognl.java:566)
at org.concordion.internal.OgnlEvaluator.evaluate (OgnlEvaluator.java:24)
at org.concordion.internal.SimpleEvaluator.evaluate (SimpleEvaluator.java:12)
at org.concordion.internal.command.ExecuteCommand$DefaultStrategy.execute (ExecuteCommand.java:49)
at org.concordion.internal.command.ExecuteCommand.execute (ExecuteCommand.java:36)
at org.concordion.api.AbstractCommandDecorator$3.run (AbstractCommandDecorator.java:42)
at org.concordion.internal.command.LocalTextDecorator.process (LocalTextDecorator.java:26)
at org.concordion.api.AbstractCommandDecorator.execute (AbstractCommandDecorator.java:40)
at org.concordion.api.AbstractCommandDecorator$3.run (AbstractCommandDecorator.java:42)
at org.concordion.internal.command.ThrowableCatchingDecorator.process (ThrowableCatchingDecorator.java:38)
at org.concordion.api.AbstractCommandDecorator.execute (AbstractCommandDecorator.java:40)
at org.concordion.api.CommandCall.execute (CommandCall.java:34)
at org.concordion.api.CommandCallList.processSequentially (CommandCallList.java:33)
at org.concordion.internal.command.SpecificationCommand.execute (SpecificationCommand.java:27)
at org.concordion.api.CommandCall.execute (CommandCall.java:34)
at org.concordion.internal.XMLSpecification.processNode (XMLSpecification.java:75)
at org.concordion.internal.XMLSpecification.processExample (XMLSpecification.java:103)
at org.concordion.Concordion.processExample (Concordion.java:103)
at org.concordion.internal.FixtureRunner.run (FixtureRunner.java:37)
at org.concordion.integration.junit4.ConcordionRunner.invoke (ConcordionRunner.java:203)
at org.concordion.integration.junit4.ConcordionRunner$1.invoke (ConcordionRunner.java:31)
at org.concordion.integration.junit4.ConcordionFrameworkMethod.invokeExplosively (ConcordionFrameworkMethod.java:58)
at org.junit.internal.runners.statements.InvokeMethod.evaluate (InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf (ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:78)
at org.concordion.integration.junit4.ConcordionRunner.runChild (ConcordionRunner.java:187)
at org.concordion.integration.junit4.ConcordionRunner.runChild (ConcordionRunner.java:23)
at org.junit.runners.ParentRunner$3.run (ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule (ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren (ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000 (ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate (ParentRunner.java:268)
at org.junit.runners.ParentRunner.run (ParentRunner.java:363)
at org.concordion.integration.junit4.ConcordionRunner.run (ConcordionRunner.java:146)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass (JUnitTestClassExecuter.java:112)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute (JUnitTestClassExecuter.java:56)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass (JUnitTestClassProcessor.java:66)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass (SuiteTestClassProcessor.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
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.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch (ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke (ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass (Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass (TestWorker.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
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.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run (MessageHub.java:360)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute (ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run (StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
at java.lang.Thread.run (Thread.java:745)
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"nonExistent"} Command duration or timeout: 78 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'testing-gce-4912bcd2-a834-4996-b186-368c0234d135.c.eco-emissary-99515.internal', ip: '10.240.0.22', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-63-generic', java.version: '1.8.0_66' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=38.4.0, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: a9bc6001-a810-4a89-9ef4-6850d0810e0a *** Element info: {Using=class name, value=nonExistent}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
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:678)
at org.openqa.selenium.remote.RemoteWebDriver.findElement (RemoteWebDriver.java:363)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByClassName (RemoteWebDriver.java:477)
at org.openqa.selenium.By$ByClassName.findElement (By.java:391)
at org.openqa.selenium.remote.RemoteWebDriver.findElement (RemoteWebDriver.java:355)
at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement (DefaultElementLocator.java:69)
at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke (LocatingElementHandler.java:38)
at com.sun.proxy.$Proxy14.click (Unknown Source)
at org.concordion.ext.demo.selenium.web.GoogleSearchPage.clickOnNonExistentLink (GoogleSearchPage.java:49)
at org.concordion.ext.demo.selenium.ExceptionTranslatorDemo.clickOnNonExistentLink (ExceptionTranslatorDemo.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
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 ognl.OgnlRuntime.invokeMethod (OgnlRuntime.java:872)
at ognl.OgnlRuntime.callAppropriateMethod (OgnlRuntime.java:1295)
at ognl.ObjectMethodAccessor.callMethod (ObjectMethodAccessor.java:68)
at ognl.OgnlRuntime.callMethod (OgnlRuntime.java:1371)
at ognl.ASTMethod.getValueBody (ASTMethod.java:90)
at ognl.SimpleNode.evaluateGetValueBody (SimpleNode.java:212)
at ognl.SimpleNode.getValue (SimpleNode.java:258)
at ognl.Ognl.getValue (Ognl.java:494)
at ognl.Ognl.getValue (Ognl.java:596)
at ognl.Ognl.getValue (Ognl.java:566)
at org.concordion.internal.OgnlEvaluator.evaluate (OgnlEvaluator.java:24)
at org.concordion.internal.SimpleEvaluator.evaluate (SimpleEvaluator.java:12)
at org.concordion.internal.command.ExecuteCommand$DefaultStrategy.execute (ExecuteCommand.java:49)
at org.concordion.internal.command.ExecuteCommand.execute (ExecuteCommand.java:36)
at org.concordion.api.AbstractCommandDecorator$3.run (AbstractCommandDecorator.java:42)
at org.concordion.internal.command.LocalTextDecorator.process (LocalTextDecorator.java:26)
at org.concordion.api.AbstractCommandDecorator.execute (AbstractCommandDecorator.java:40)
at org.concordion.api.AbstractCommandDecorator$3.run (AbstractCommandDecorator.java:42)
at org.concordion.internal.command.ThrowableCatchingDecorator.process (ThrowableCatchingDecorator.java:38)
at org.concordion.api.AbstractCommandDecorator.execute (AbstractCommandDecorator.java:40)
at org.concordion.api.CommandCall.execute (CommandCall.java:34)
at org.concordion.api.CommandCallList.processSequentially (CommandCallList.java:33)
at org.concordion.internal.command.SpecificationCommand.execute (SpecificationCommand.java:27)
at org.concordion.api.CommandCall.execute (CommandCall.java:34)
at org.concordion.internal.XMLSpecification.processNode (XMLSpecification.java:75)
at org.concordion.internal.XMLSpecification.processExample (XMLSpecification.java:103)
at org.concordion.Concordion.processExample (Concordion.java:103)
at org.concordion.internal.FixtureRunner.run (FixtureRunner.java:37)
at org.concordion.integration.junit4.ConcordionRunner.invoke (ConcordionRunner.java:203)
at org.concordion.integration.junit4.ConcordionRunner$1.invoke (ConcordionRunner.java:31)
at org.concordion.integration.junit4.ConcordionFrameworkMethod.invokeExplosively (ConcordionFrameworkMethod.java:58)
at org.junit.internal.runners.statements.InvokeMethod.evaluate (InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunAfters.evaluate (RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf (ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild (BlockJUnit4ClassRunner.java:78)
at org.concordion.integration.junit4.ConcordionRunner.runChild (ConcordionRunner.java:187)
at org.concordion.integration.junit4.ConcordionRunner.runChild (ConcordionRunner.java:23)
at org.junit.runners.ParentRunner$3.run (ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule (ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren (ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000 (ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate (ParentRunner.java:268)
at org.junit.runners.ParentRunner.run (ParentRunner.java:363)
at org.concordion.integration.junit4.ConcordionRunner.run (ConcordionRunner.java:146)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass (JUnitTestClassExecuter.java:112)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute (JUnitTestClassExecuter.java:56)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass (JUnitTestClassProcessor.java:66)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass (SuiteTestClassProcessor.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
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.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch (ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke (ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass (Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass (TestWorker.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
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.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch (ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run (MessageHub.java:360)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute (ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run (StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
at java.lang.Thread.run (Thread.java:745)
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"class name","selector":"nonExistent"} For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'testing-gce-4912bcd2-a834-4996-b186-368c0234d135.c.eco-emissary-99515.internal', ip: '10.240.0.22', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-63-generic', java.version: '1.8.0_66' Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.findElementInternal_ (file:///tmp/anonymous8042984345416927516webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10770)
at <anonymous class>.FirefoxDriver.prototype.findElement (file:///tmp/anonymous8042984345416927516webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10779)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h (file:///tmp/anonymous8042984345416927516webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12661)
at <anonymous class>.DelayedCommand.prototype.executeInternal_ (file:///tmp/anonymous8042984345416927516webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12666)
at <anonymous class>.DelayedCommand.prototype.execute/< (file:///tmp/anonymous8042984345416927516webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12608)