我已经使用 selenium webdriver 准备了一个测试用例,我使用 MSTEST 在本地运行,它工作正常,现在我想将我的测试用例移动到 JENKINS,当我从 JENKINS 运行时,它说它Starting execution...
超过 15 mnts 并且仍然相同状态,所以我必须手动停止它。
这是我的控制台输出:
Started by user anonymous
Started by user anonymous
Building in workspace D:\Jenkins\jobs\Selenium_Script\workspace
[workspace] $ cmd /c call C:\Users\XXXXXXX\AppData\Local\Temp\hudson4765437871038045571.bat
D:\Jenkins\jobs\SelScript\workspace>call "D:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest" /testcontainer:D:\Sel\EmployeeTest\test.emp.admin.dll
Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Loading D:\Sel\EmployeeTest\test.emp.admin.dll...
Starting execution...
Build was aborted
Finished: ABORTED
我想在 Jenkins 上执行测试用例并检查执行结果
这是我正在使用的代码以防万一。
这是我用来实例化驱动程序的东西,我必须使用RemoteDriver
吗?
public static IWebDriver GetDriver()
{
string _url = new Uri(Common.Url).DnsSafeHost.ToString();
switch (Common.BrowserSelected)
{
case "ff":
FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("network.http.phishy-userpass-length", 255);
profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", _url);
drv = new FirefoxDriver(profile);
break;
case "ie":
var options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.SetCapability(CapabilityType.AcceptSslCertificates, true);
drv = new InternetExplorerDriver(options);
break;
case "chrome":
//_driver = new ChromeDriver();
break;
}
return drv;
}