Chrome由自动化测试软件控制 [英] Chrome is being controlled by automated test software

查看:1174
本文介绍了Chrome由自动化测试软件控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Serenity BDD(Selenium)在Chrome中运行自动化测试。



我不得不下载新的ChromeDriver,因为我的测试无法运行 - >测试会打开ChromeDriver,但无法以用户身份浏览。当我搜索问题时,他们说我必须更新ChromeDriver。



所以我将ChromeDriver更新到版本2.28,我还将Chrome版本更新为版本57.0.2987.98。 / p>

但是现在 - 每次我运行测试时都会出现这个烦人的文字:


Chrome由自动测试软件控制


它询问我是否要保存密码。 (我无法添加图片,因为我没有足够的积分)



在之前的版本中,我设法阻止了这两件事:

 公共类CustomChromeDriver实现DriverSource {

@Override
public WebDriver newDriver(){
try {
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
代理代理=新代理();
String proxyServer = String.format(AProxyIDontWantToDisplay,System.getenv(proxy.username),System.getenv(proxy.password));
proxy.setHttpProxy(proxyServer);
capabilities.setCapability(proxy,proxy);
ChromeOptions选项=新ChromeOptions();
options.addArguments(Arrays.asList( - no-sandbox, - ignore-certificate-errors, - homepage = about:blank, - no-first-run) );
capabilities.setCapability(ChromeOptions.CAPABILITY,options);
ChromeDriver驱动程序=新的C​​hromeDriver(功能);
返回司机;
} catch(异常e){
抛出新错误(e);
}
}

@Override
public boolean takesScreenshots(){
return true;
}
}

我知道有这一个(相同问题的链接),
但是有太多的答案无效。



任何知道如何移除它的人?

解决方案

添加此项传递给驱动程序的选项:

  options.addArguments(disable-infobars); 


I am running automated tests in Chrome with Serenity BDD (Selenium).

I had to download a new ChromeDriver, because my tests could not run -> The test would open ChromeDriver but could not "Browse as user". When I googled the issue, they said I had to update ChromeDriver.

So I updated ChromeDriver to version 2.28 and I also updated the Chrome version to Version 57.0.2987.98.

But now - EVERY TIME I run my tests this annoying text comes up:

Chrome is being controlled by automated test software

And it asks me if I want to save password. (I can't add pictures because I don't have enough "points")

In the previous version, I had managed to block these 2 things by:

public class CustomChromeDriver implements DriverSource {

    @Override
    public WebDriver newDriver() {
        try {
            DesiredCapabilities capabilities = DesiredCapabilities.chrome();
            Proxy proxy = new Proxy();
            String proxyServer = String.format("AProxyIDontWantToDisplay", System.getenv("proxy.username"), System.getenv("proxy.password"));
            proxy.setHttpProxy(proxyServer);
            capabilities.setCapability("proxy", proxy);
            ChromeOptions options = new ChromeOptions();
            options.addArguments(Arrays.asList("--no-sandbox","--ignore-certificate-errors","--homepage=about:blank","--no-first-run"));
            capabilities.setCapability(ChromeOptions.CAPABILITY, options);
            ChromeDriver driver = new ChromeDriver(capabilities);
            return driver;
        } catch (Exception e) {
            throw new Error(e);
        }
    }

    @Override
    public boolean takesScreenshots() {
        return true;
    }
}

I know there is this one (A link to same issue), but there are too many answers that don't work.

Anybody that knows how to remove that?

解决方案

Add this to the options you pass to the driver:

options.addArguments("disable-infobars");

这篇关于Chrome由自动化测试软件控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆