【发布时间】:2016-09-20 19:30:59
【问题描述】:
我正在尝试使用 Bamboo 的构建和部署功能在我的项目中运行 Selenium 自动化测试。
我们目前正在使用 Maven 任务来构建和运行常规 JUNIT 测试,并且计划在代码成功部署到服务器后使用另一个 Maven 任务来运行 Selenium 测试。目前,一切似乎在本地运行得很好,但是当竹子尝试运行 Selenium 测试时,它似乎无限期地挂起。不幸的是,我无法远程访问服务器以直接观看,但我知道它是运行操作系统版本的 Microsoft 服务器:Windows 2012 R2 64 位。我也知道服务器正在使用 java 版本“1.8.0_101”,这与我的本地设置相同。我在下面包含了我正在运行的代码示例。
import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SeleniumTestExample {
WebDriver driver;
@Before
public void setup(){
System.setProperty("webdriver.ie.driver", "src/test/resources/IEDriverServer32bit.exe");
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
driver = new InternetExplorerDriver(null, ieCapabilities);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://google.com");
}
@Test
public void printPageTitle(){
System.out.println("Title of Page is: " + driver.getTitle());
driver.quit();
}
}
通过 Bamboo 运行时,日志中唯一的输出是行...
已启动 InternetExplorerDriver 服务器(32 位)
2.53.1.0
监听 8080 端口
只允许本地连接
【问题讨论】:
-
你想在哪里运行你的测试,在 CI (bamboo) 服务器上?
-
是的,我正在尝试在竹服务器上运行这些测试,但您能否详细说明您的问题?
标签: java maven selenium bamboo