我试图对IE8进行测试,但遇到了一个奇怪的问题:
有什么想法吗?
发布于 2012-08-21 12:58:35
根据Jim (硒开发人员之一)在this thread at WebDriver User Group中给出的答案,下面的代码应该可以解决您的问题。
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability("ignoreZoomSetting", true);
driver = new InternetExplorerDriver(caps);发布于 2014-09-10 07:18:15
因为这个问题不是用特定的语言标记的,而且由于JacekM's answer在C#中对我不起作用(考虑到大小写,我假设他的是for Java.)。我将在这里为C#提供相应的解决方案:
var service = InternetExplorerDriverService.CreateDefaultService(@"Path\To\Driver");
// properties on the service can be used to e.g. hide the command prompt
var options = new InternetExplorerOptions
{
IgnoreZoomLevel = true
};
var ie = new InternetExplorerDriver(service, options);发布于 2015-11-04 11:55:50

要快速修复它,请将浏览器缩放到100%。
https://stackoverflow.com/questions/12034969
复制相似问题