我遇到的问题是,我在多个浏览器中运行我的测试,但注意到Firefox的加载时间要慢得多。我正在实现像这样的多个浏览器。
[TestFixture(typeof(FirefoxDriver))]
[TestFixture(typeof(ChromeDriver))]
[TestFixture(typeof(InternetExplorerDriver))]
public class UnitTest1<TWebDriver> where TWebDriver : IWebDriver, new()
{
PTGeneral General;
[TestFixtureSetUp]
public void SetUp()
{
General = new PTGeneral();
General.Driver = new TWebDriver();
General.PT_URL = "https://chi-pt-dev1.corp.auctiva.com/";
}我需要做的是让Firefox驱动程序的默认超时时间超过60秒。
当我使用这种方法启动Firefox驱动程序时,一切都很好。
General.Driver = new FirefoxDriver(new FirefoxBinary(), new FirefoxProfile(), TimeSpan.FromSeconds(180));我有办法娶这两个人吗?
或者,当我通过TimeSpan.FromSeconds(180)时,有人知道在驱动程序中设置了什么变量吗?是否可以在运行时更改此值?
发布于 2015-12-04 14:40:13
你可以试试这个:
driver.manage().timeouts().implicitlyWait(180, TimeUnit.SECONDS)它将允许您根据需要更改超时。
https://stackoverflow.com/questions/34078502
复制相似问题