0

我使用 SpecFlow、PhantomJS、Selenium 和 FluentAutomation.NET 编写了几个测试。它们在 Chrome 和 FireFox 上运行良好,但是当我在 PhantomJS 上运行它们时,它们失败了。

错误信息是:

元素当前不可交互且可能无法操作

搜索显示这通常是由元素不在屏幕上、页面未完全加载或其他随机故障引起的。插入等待并不能解决它,并且设置.With.WindowSize(1980, 1080)也不起作用。

代码非常简单,几乎直接来自示例

I.Focus(SearchInput);
I.Scroll(SearchInput);
I.Enter(searchText).In(SearchInput);
4

1 回答 1

0

事实证明,通过 Settings 对象设置WindowWithand~Height确实很神奇:

SeleniumWebDriver.Bootstrap(
    SeleniumWebDriver.Browser.PhantomJs
);

FluentSettings.Current.WindowHeight = 1080;
FluentSettings.Current.WindowWidth = 1980;
于 2015-12-07T19:04:29.193 回答