首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Teamcity构建错误

Teamcity构建错误
EN

Stack Overflow用户
提问于 2017-06-26 18:27:11
回答 1查看 201关注 0票数 0

当我在本地运行我的自动化测试脚本时,它工作得非常好,没有任何错误消息。但是当我在服务器上运行时,我可以看到它工作正常,但在最后,它显示的不是通过状态,而是测试失败。

代码语言:javascript
运行
复制
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 282.662 sec <<<
FAILURE!
allNumbersEditorsDraws(NumbersEditor.TestSuiteAdmin)  Time elapsed: 0.047 sec  <
<< FAILURE!
org.openqa.selenium.remote.SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'W-SL-DEVBUILD1', ip: '10.130.32.68', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:134)
       at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
        at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363)
        at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:500)
        at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
        at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355)
        at NumbersEditor.LoginPage.loginAdmin(LoginPage.java:32)
        at NumbersEditor.TestSuiteAdmin.allNumbersEditorsDraws(TestSuiteAdmin.java:18)


Results :

Failed tests:   allNumbersEditorsDraws(NumbersEditor.TestSuiteAdmin): Session ID is null. Using WebDriver after calling quit()?(..)

Tests run: 3, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:50 min
[INFO] Finished at: 2017-06-26T10:41:18+01:00
[INFO] Final Memory: 13M/328M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
12.4:test (default-test) on project NumbersEditor: There are test failures.
[ERROR]
[ERROR] Please refer to C:\BuildAgent\work\f3b21200f1a5caf2\Automation\target\su
refire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
EN

回答 1

Stack Overflow用户

发布于 2017-06-26 20:10:20

在虚拟机上使用Selenium进行UI测试时,这是一个常见的问题。当您运行测试时,您的会话应该是活动的。因此,如果您连接到虚拟机上的远程桌面,则当前脚本正在运行,但如果您退出,则当前会话将消失。

为了使其正常工作,您应该将当前的远程会话保留为一个脚本:

代码语言:javascript
运行
复制
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
  %windir%\System32\tscon.exe %%s /dest:console
)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44757665

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档