久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='MX8rl'></bdo><ul id='MX8rl'></ul>
    <legend id='MX8rl'><style id='MX8rl'><dir id='MX8rl'><q id='MX8rl'></q></dir></style></legend>
    1. <small id='MX8rl'></small><noframes id='MX8rl'>

      <i id='MX8rl'><tr id='MX8rl'><dt id='MX8rl'><q id='MX8rl'><span id='MX8rl'><b id='MX8rl'><form id='MX8rl'><ins id='MX8rl'></ins><ul id='MX8rl'></ul><sub id='MX8rl'></sub></form><legend id='MX8rl'></legend><bdo id='MX8rl'><pre id='MX8rl'><center id='MX8rl'></center></pre></bdo></b><th id='MX8rl'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MX8rl'><tfoot id='MX8rl'></tfoot><dl id='MX8rl'><fieldset id='MX8rl'></fieldset></dl></div>
    2. <tfoot id='MX8rl'></tfoot>

        chromedriver 在前臺運行的 windows jenkins slave 上失敗

        chromedriver fails on windows jenkins slave running in foreground(chromedriver 在前臺運行的 windows jenkins slave 上失敗)
        • <i id='0C02k'><tr id='0C02k'><dt id='0C02k'><q id='0C02k'><span id='0C02k'><b id='0C02k'><form id='0C02k'><ins id='0C02k'></ins><ul id='0C02k'></ul><sub id='0C02k'></sub></form><legend id='0C02k'></legend><bdo id='0C02k'><pre id='0C02k'><center id='0C02k'></center></pre></bdo></b><th id='0C02k'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0C02k'><tfoot id='0C02k'></tfoot><dl id='0C02k'><fieldset id='0C02k'></fieldset></dl></div>
        • <small id='0C02k'></small><noframes id='0C02k'>

        • <tfoot id='0C02k'></tfoot>

                  <bdo id='0C02k'></bdo><ul id='0C02k'></ul>
                • <legend id='0C02k'><style id='0C02k'><dir id='0C02k'><q id='0C02k'></q></dir></style></legend>
                    <tbody id='0C02k'></tbody>

                  本文介紹了chromedriver 在前臺運行的 windows jenkins slave 上失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  有沒有什么技巧可以讓 Win Jenkins slave 使用 chromedriver?

                  Is there a trick to getting Win Jenkins slave to be OK with chromedriver?

                  我的測試從 maven 存儲庫中提取 chromedriver 和便攜式 chrome,然后執行它們.在我的本地以及當我的構建用戶在我的構建系統上執行相同操作時工作正常.

                  My tests pull chromedriver and portable chrome from a maven repo and then execute them. The work fine on my local and when my build users does the same on my build systems.

                  當 jenkins 做同樣的事情時,即使在前臺(不是 svc)運行時,它也會失敗并出現以下錯誤.我嘗試通過參數來提高詳細程度,但無濟于事.

                  When jenkins does the same thing, even when running in the foreground (not a svc) it fails with the error below. I've tried passing params to boost the verbosity to no avail.

                  org.openqa.selenium.WebDriverException:未知錯誤:Chrome 啟動失敗:正常退出(驅動程序信息:chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.1.7601 SP1 x86_64)(警告:服務器未提供任何堆棧跟蹤信息)命令持續時間或超時:62.63 秒構建信息:版本:'2.41.0',修訂:'3192d8a6c4449dc285928ba024779344f5423c58',時間:'2014-03-27 11:29:39'系統信息:主機:'winengbld15',ip:'10.2.2.105',os.name:'Windows Server 2008 R2',os.arch:'amd64',os.version:'6.1',java.version:'1.8.0_40'驅動程序信息:org.openqa.selenium.chrome.ChromeDriver在 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)在 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)在 java.lang.reflect.Constructor.newInstance(Constructor.java:422)在 org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)在 org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)在 org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)在 org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:181)在 org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)在 org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:139)在 org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:160)在 org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:128)

                  org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 62.63 seconds Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39' System info: host: 'winengbld15', ip: '10.2.2.105', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_40' Driver info: org.openqa.selenium.chrome.ChromeDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240) at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:181) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:139) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:160) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:128)

                  我是這樣設置 Chrome 驅動的:

                  I setup the Chrome driver thus:

                  defaultPath = "target/drivers/chromedriver.exe";
                  System.setProperty("webdriver.chrome.driver", defaultPath);
                  ChromeLocator locator = new ChromeLocator();
                  driver = new ChromeDriver(locator.getCapabilities());
                  
                  public class ChromeLocator {
                    private static final Logger log = Logger.getLogger(ChromeLocator.class);
                  
                    /**
                     * Obtain Chrome Configuration with location of binary
                     * @return
                     * @throws IOException 
                     */
                    public DesiredCapabilities getCapabilities() throws IOException {
                      Map<String, Object> chromeOptions = new HashMap<String, Object>();
                      chromeOptions.put("binary", getChromeExecutableLocation().getAbsolutePath());
                  
                      DesiredCapabilities capabilities = DesiredCapabilities.chrome();
                      capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
                  
                      return capabilities;
                    }
                  
                    // Windows defaults to unpacked location
                    private File getChromeExecutableLocation() throws IOException {
                  
                      File chromeExe;
                  
                      if (SystemUtils.IS_OS_WINDOWS) {
                        chromeExe = new File(System.getProperty("win.google.chrome.bin"));  
                        log.info("*** win.google.chrome.bin: " + System.getProperty("win.google.chrome.bin"));
                      } else {
                        // Use the standard locator option for all other operating systems
                        GoogleChromeLocator locator = new GoogleChromeLocator();
                        BrowserInstallation installation = locator.findBrowserLocationOrFail();
                        chromeExe = new File(installation.launcherFilePath());
                      }
                      log.info("Chrome Exe: " + chromeExe.getAbsolutePath() + " Is File: " + chromeExe.isFile());
                      if (! chromeExe.exists() || ! chromeExe.isFile()) {
                        throw new IOException("Cannot locate Chrome Executable.  Expected Location: " + chromeExe.getAbsolutePath());
                      }
                      return chromeExe;
                    }
                  }
                  

                  推薦答案

                  我們有幾個問題,關鍵似乎是 Chrome 的無沙盒選項.下面是一個適用于桌面和在前臺或通過服務運行的 jenkins slave 的解決方案.

                  We have several issues and the key seems to be the no-sandbox option to Chrome. Below is a solution that works on the desktop and on a jenkins slave running in the foreground or via service.

                  第一部分:Maven 解包 Chrome &司機

                  • 下載 PortableApps GoogleChrome
                  • 安裝
                  • 將目錄重命名為通用名稱 (GoogleChrome)
                  • 壓縮目錄
                  • 添加到存儲庫管理器
                  • 設置 maven-dependency-plugin 執行以解包

                  • Download PortableApps GoogleChrome
                  • Install
                  • Rename dir to generic name (GoogleChrome)
                  • Zip dir
                  • add to repository manager
                  • setup maven-dependency-plugin executions to unpack

                    <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-dependency-plugin</artifactId>
                  <version>2.8</version>
                  <executions>
                   <execution>
                     <id>extract portable google chrome</id>
                     <phase>process-test-resources</phase>
                     <goals>
                       <goal>unpack</goal>
                     </goals>
                     <configuration>
                       <skip>${skipWinChromeUnpack}</skip>
                       <markersDirectory>${project.build.directory}/dependency-maven-plugin-markers/googlechrome</markersDirectory>
                       <overWriteIfNewer>false</overWriteIfNewer>
                       <artifactItems>
                         <artifactItem>
                            <groupId>com.google.chromium</groupId>
                            <artifactId>chromedriver</artifactId>
                            <version>${win.chromedriver.version}</version>                
                            <classifier>win32</classifier>
                            <type>zip</type>
                          <outputDirectory>${project.build.directory}</outputDirectory>
                         </artifactItem>
                         <artifactItem>
                            <groupId>com.portableapps</groupId>
                            <artifactId>googlechrome</artifactId>
                            <version>${win.chrome.version}</version>
                            <classifier>win64</classifier>
                            <type>zip</type>
                          <outputDirectory>${project.build.directory}</outputDirectory>
                         </artifactItem>
                       </artifactItems>
                     </configuration>
                   </execution>         
                  


                  結果在測試執行時,我們有 target/chromedriver.exe 和 target/GooglePortable/Google...exe 文件可供使用

                  Result At test execution time we have target/chromedriver.exe and target/GooglePortable/Google...exe files to use

                  第二部分:Maven Surefire 配置

                  我們為驅動程序和 chrome exe 的位置設置系統屬性以傳遞給所有單元測試

                  We set System properties for location of driver and chrome exe to pass down to all unit tests

                          <systemPropertyVariables>
                            <webdriver.chrome.driver>${project.build.directory}/chromedriver.exe</webdriver.chrome.driver>
                            <win.google.chrome.bin>${win.chrome.exe}</win.google.chrome.bin>  
                          </systemPropertyVariables>
                  

                  第三部分:測試代碼

                  我們使用 chrome 驅動程序服務構建器將詳細程度設置為 11,并使用我們最喜歡的功能啟動驅動程序

                  We use chrome driver service builder to set verbosity to 11 and start the driver using our favorite capabilities from that

                  public class ChromeLocator {
                      private static final Logger log = Logger.getLogger(ChromeLocator.class);
                  
                  /**
                   * Obtain Chrome Configuration with location of binary
                   * @return
                   * @throws IOException
                   */
                  public DesiredCapabilities getCapabilities() throws IOException {
                      ChromeOptions chromeOptions = new ChromeOptions();
                      chromeOptions.setBinary(getChromeExecutableLocation().getAbsolutePath());
                      chromeOptions.addArguments("no-sandbox");
                      DesiredCapabilities capabilities = DesiredCapabilities.chrome();
                      capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
                  
                  
                      return capabilities;
                  }
                  
                  // Windows defaults to unpacked location
                  private File getChromeExecutableLocation() throws IOException {
                  
                      File chromeExe;
                  
                      if (SystemUtils.IS_OS_WINDOWS) {
                          chromeExe = new File(System.getProperty("win.google.chrome.bin"));
                      } else {
                          // Use the standard locator option for all other operating systems
                          GoogleChromeLocator locator = new GoogleChromeLocator();
                          BrowserInstallation installation = locator.findBrowserLocationOrFail();
                          chromeExe = new File(installation.launcherFilePath());
                      }
                      System.out.println("Chrome Exe: " + chromeExe.getAbsolutePath() + " Is File: " + chromeExe.isFile());
                      if (! chromeExe.exists() || ! chromeExe.isFile()) {
                          throw new IOException("Cannot locate Chrome Executable.  Expected Location: " + chromeExe.getAbsolutePath());
                      }
                      return chromeExe;
                  }
                  

                  }

                  public class WebTest
                  
                  {
                  static ChromeDriverService service = null;
                  static WebDriver driver = null;
                  
                  @BeforeClass
                  static public void setupOnce() throws IOException {
                  
                      // Setup ChromeDriver with Verbosity on - perhaps control via system property - off by default?
                      service = new ChromeDriverService.Builder()
                              .withVerbose(true)
                              .usingAnyFreePort()
                              .build();
                  
                      service.start();
                  
                      // Setup locator to find unpacked Portable chrome exe
                      ChromeLocator locator = new ChromeLocator();
                  
                      // Use service + capabilities from locator to open driver with settings and chrome bin
                      driver = new RemoteWebDriver(service.getUrl(), locator.getCapabilities());
                  }
                  
                  @AfterClass
                  static public void teardownOnce() {
                      if (null != service) {
                          service.stop();
                          service = null;
                      }
                  }
                  @Test
                  public void testGoogleSearch() throws InterruptedException, IOException {
                      driver.get("http://www.google.com/xhtml");
                      assertEquals("Google", driver.getTitle());
                  
                      WebElement searchBox = driver.findElement(By.name("q"));
                      String searchString = "ChromeDriver";
                      searchBox.sendKeys(searchString);
                      searchBox.submit();
                  
                      String source = driver.getPageSource().toString();
                      assertTrue("Expected DOCTYPE in
                  " + source,
                              source.contains("DOCTYPE"));
                      driver.quit();
                      service.stop();
                  
                  }
                  

                  }

                  這篇關于chromedriver 在前臺運行的 windows jenkins slave 上失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                    <bdo id='iNNkb'></bdo><ul id='iNNkb'></ul>

                        <tfoot id='iNNkb'></tfoot>
                        1. <i id='iNNkb'><tr id='iNNkb'><dt id='iNNkb'><q id='iNNkb'><span id='iNNkb'><b id='iNNkb'><form id='iNNkb'><ins id='iNNkb'></ins><ul id='iNNkb'></ul><sub id='iNNkb'></sub></form><legend id='iNNkb'></legend><bdo id='iNNkb'><pre id='iNNkb'><center id='iNNkb'></center></pre></bdo></b><th id='iNNkb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iNNkb'><tfoot id='iNNkb'></tfoot><dl id='iNNkb'><fieldset id='iNNkb'></fieldset></dl></div>
                            <tbody id='iNNkb'></tbody>

                          <small id='iNNkb'></small><noframes id='iNNkb'>

                          <legend id='iNNkb'><style id='iNNkb'><dir id='iNNkb'><q id='iNNkb'></q></dir></style></legend>

                            主站蜘蛛池模板: 日韩一区在线播放 | 日韩中文在线观看 | 久久男人 | 亚洲欧美日韩精品久久亚洲区 | 成人午夜av | 欧美中文字幕一区二区三区亚洲 | 日韩美av| 精品久久久久久久久久久久久久 | h视频亚洲 | 91传媒在线观看 | 特黄毛片| 久久婷婷色 | 国产黄色大片在线观看 | 欧美日韩在线精品 | 国产高清久久久 | 久久综合狠狠综合久久综合88 | 看片天堂 | 日韩免费高清视频 | 亚洲v日韩v综合v精品v | 国偷自产av一区二区三区 | 成人毛片网站 | 成人中文字幕在线 | 午夜小电影| 羞羞视频网站免费观看 | 日本精品一区二区三区在线观看视频 | 欧美精品网站 | 视频二区在线观看 | 欧美日韩一区二区在线播放 | 亚洲一区二区三区四区五区午夜 | 日韩 国产 在线 | 狠狠色综合欧美激情 | 亚洲一区 | 在线日韩不卡 | 亚洲 欧美 综合 | 精品国产一区二区三区久久久蜜月 | 成人午夜视频在线观看 | 亚洲综合国产精品 | 特黄色毛片| 中文字幕一页二页 | 一区二区中文字幕 | 欧美一区二区另类 |