我正在使用SE2和firefoxDriver在無頭環境 環境(Xvfb)中運行測試。隨着FirefoxDriver我可以設置顯示環境屬性很容易 :以編程方式將環境屬性設置爲ChromeDriver
FirefoxBinary firefox = new FirefoxBinary();
firefox.setEnvironmentProperty("DISPLAY",":"+DISPLAY);
FirefoxProfile firefoxProfile = new ProfilesIni().getProfile(Config.webDriverFirefoxProfile);
this.webDriver = new FirefoxDriver(firefox,firefoxProfile);
我如何能做到以上ChromeDriver?
更新:似乎這是不可能做到!有與我在這裏過類似的問題,其中介紹了情況:ChromeDriver Headless