我尝试使用testng.xml build.xml执行sahi和selenium脚本。由于两个脚本都在同一个项目中配置,我认为可以从Jenkins触发两个脚本。
但现在我只能触发Selenium脚本,而不能触发Jenkins的Sahi脚本。
抛出的异常是:
error:_sahi.setServerVarPlain('___lastValue___Fri May 22 13:58:57 IST 2015', _sahi.loaded)
TypeError: Object doesn't support property or method 'setServerVarPlain'
No trace available
<a href='/_s_/dyn/Log_getBrowserScript?href=null&n=-1'><b>Click for browser script</b></a>
at net.sf.sahi.client.Browser.executeStep(Browser.java:320)
at net.sf.sahi.client.Browser.executeStep(Browser.java:293)
at net.sf.sahi.client.Browser.execute(Browser.java:262)
at net.sf.sahi.client.Browser.fetch(Browser.java:708)
at net.sf.sahi.client.Browser.navigateTo(Browser.java:193)
at net.sf.sahi.client.Browser.navigateTo(Browser.java:181)
at com.base.sahi.SonnetTestNGSahiBase.testSetup(SonnetTestNGSahiBase.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:653)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
还尝试谷歌此错误,但无法找到任何解决方案。
我使用Selenium Webdriver,Sahi Pro(试用版)。