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

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

  • <tfoot id='Ye9o5'></tfoot>
      • <bdo id='Ye9o5'></bdo><ul id='Ye9o5'></ul>

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

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

        “Chrome Legacy Window"的自動化(鉻)使用 Winium

        Automation for quot;Chrome Legacy Windowquot; (Chromium) using Winium(“Chrome Legacy Window的自動化(鉻)使用 Winium)

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

                <tfoot id='ed5qy'></tfoot>

                • <small id='ed5qy'></small><noframes id='ed5qy'>

                    <tbody id='ed5qy'></tbody>
                  本文介紹了“Chrome Legacy Window"的自動化(鉻)使用 Winium的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使用 Winium 自動化 Windows 應用程序 GUI.該應用同時使用 WPF 窗口和Chrome Legacy Window"(Chromium) 窗口.

                  我正在使用工具 "Automation Spy" 在 WPF 窗口中檢查 GUI 元素的 ID 以與 Winium 一起使用.Automation Spy 無法檢查Chrome Legacy Window"窗口中的元素,就像 Winium 無法訪問這些元素一樣.

                  Chrome Legacy Window"是一個 WEB 窗口,因此需要使用 Selenium 進行自動化.

                  我如何使用 Selenium 來掛鉤 Chromium 窗口,它不是像 Firefox、Chrome 和類似瀏覽器的瀏覽器?

                  解決方案

                  遠程調試端口"是我的問題的解決方案.

                  1. 我將remote-debugging-port=XXXX"添加到我的 CEF(Chromium 嵌入式框架)命令中:https://blog.chromium.org/2011/05/remote-debugging-with-chrome-developer.html這讓我可以通過 localhost:XXXX 查看和管理我的應用程序的 CEF 窗口.

                  2. 我同時使用了 Winium 和 Selenium 來測試我的應用程序.Winium 用于我所有的 WPF 窗口,而 selenium 用于我的所有 CEF 窗口.我的 GUI 測試從 Winium 驅動程序開始,以打開我的應用程序并導航 WPF 窗口.每次我需要調試 CEF 窗口時,我都會使用 selenium 和remote-debugging-port"參數打開一個 Chrome 驅動程序,它允許我單擊該窗口內的元素.當我完成這個 chromium 窗口時,我將關閉 selenium 驅動程序并繼續使用 Winium.

                  在 IntelliJ IDEA 中使用 Selenium 和 Winium

                  Selenium 是一個可移植的框架,用于測試和自動化 Web 應用程序.Winium 是一個基于 Selenium 的工具,用于在 Windows 上測試和自動化桌面應用程序.要在 IntelliJ IDEA 項目中使用這些模塊,請按照以下步驟操作:

                  1. 下載 selenium-server-standalone jar 文件(例如 selenium-server-standalone-3.141.59.jar)https://www.seleniumhq.org/download/
                  2. 下載 winium-webdriver jar 文件(例如 winium-webdriver-0.1.0-1.jar)http://central.maven.org/maven2/com/github/2gis/winium/winium-webdriver/0.1.0-1/
                  3. 將兩個 jars 添加到您的項目結構中:文件 → 項目結構 → 依賴項 → +
                  4. 現在所有的 Selenium 和 Winium 導入都應該可以工作了.例如:

                    import org.openqa.selenium.By;導入 org.openqa.selenium.WebDriver;導入 org.openqa.selenium.chrome.ChromeDriver;導入 org.openqa.selenium.chrome.ChromeOptions;導入 org.openqa.selenium.support.ui.ExpectedConditions;導入 org.openqa.selenium.support.ui.WebDriverWait;導入 org.openqa.selenium.winium.DesktopOptions;導入 org.openqa.selenium.winium.WiniumDriver;導入 org.openqa.selenium.winium.WiniumDriverService;

                  將 ChromeDriver 與 Selenium 一起使用

                  按照以下步驟操作:

                  1. 安裝 Java JDK 并將其 bin 目錄添加到系統 PATH變量.
                  2. 創建一個包含所有文件的目錄.本教程使用 c: emp.
                  3. 下載 ChromeDriver 并解壓(如 chromedriver_win32.zip 提供 chomedriver.exe)https://sites.google.com/a/chromium.org/chromedriver/下載
                  4. 下載 selenium-server-standalone-X.X.X-alpha-1.zip(例如 selenium-server-standalone-4.0.0-alpha-1.zip)http://selenium-release.storage.googleapis.com/index.html
                  5. 從 Cefbuilds 下載 CEF 二進制分發客戶端并提取(例如 cef_binary_76.1.13+gf19c584+chromium-76.0.3809.132_windows64.tar.bz2)http://opensource.spotify.com/cefbuilds/index.html
                  6. 您的目錄結構現在應該如下所示:

                  <塊引用>

                  c:	empcef_binary_3.2171.1979_windows32_client發布cefclient.exe(和其他文件)chromedriver.exeExample.javaselenium-server-standalone-2.44.0.jar

                  有關更多信息,您可以閱讀此 wiki:https://bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md

                  在 Winium 中使用 WiniumDriver

                  按照以下步驟操作:

                  1. 下載 Winium.Desktop.Driver.zip 并解壓到 c: emphttps://github.com/2gis/Winium.Desktop/releases

                  Java 代碼示例

                  啟動一個winium驅動并打開你的應用:

                  DesktopOptions desktopOption = new DesktopOptions();desktopOption.setApplicationPath("Path_to_your_app.exe");文件 drivePath = new File("C:\temp\Winium.Desktop.Driver.exe");WiniumDriverService 服務 = 新 WiniumDriverService.Builder().usingDriverExecutable(drivePath).usingPort(9999).withVerbose(true).withSilent(false).buildDesktopService();服務.start();WiniumDriver winiumDriver = WiniumDriver(service, desktopOption);

                  使用 winium 導航和測試 WPF 窗口.例如:

                  winiumDriver.findElement(By.id("someElementID")).click();

                  創建一個 ChromeOptions 對象,該對象包含所有需要的 selenium 信息,例如 chromium 客戶端和遠程調試端口.確保將XXXX"端口更改為您的遠程調試端口.

                  System.setProperty("webdriver.chrome.driver", "c:/temp/chromedriver.exe");ChromeOptions chromeOptions = new ChromeOptions();chromeOptions.setBinary("c:/temp/cef_binary_76.1.13+gf19c584+chromium-76.0.3809.132_windows64_client/Release/cefclient.exe");chromeOptions.addArguments("遠程調試端口=XXXX");

                  使用 chrome 選項對象打開一個 chrome 驅動程序 (selenium).

                  WebDriver seleniumDriver = ChromeDriver(chromeOptions);

                  在鉻窗口內使用元素.例如:

                  seleniumWait.until(ExpectedConditions.visibilityOfElementLocated(By.className("someButtonClassName")));seleniumDriver.findElement(By.className("someButtonClassName")).click();

                  完成 CEF 窗口后,關閉 selenium 驅動程序并繼續使用 winium 驅動程序:

                  seleniumDriver.quit();winiumDriver.findElement(By.id("someElementID")).click();

                  關閉主winium驅動:

                  winiumDriver.quit();

                  I'm trying to automate a Windows application GUI using Winium. The app is using both WPF windows and "Chrome Legacy Window" (Chromium) windows.

                  I'm using the tool "Automation Spy" to inspect the GUI elements' ids inside the WPF windows to use with Winium. Automation Spy can't inspect elements in the "Chrome Legacy Window" windows in the same manner that Winium can't access these elements.

                  "Chrome Legacy Window" is a WEB window, so it requires automation with Selenium.

                  How do I use Selenium to hook on a Chromium window, which is not a browser like Firefox, Chrome and similar?

                  解決方案

                  "Remote Debugging Port" was the solution for my problem.

                  1. I added the "remote-debugging-port=XXXX" to my CEF (Chromium Embedded Framework) command: https://blog.chromium.org/2011/05/remote-debugging-with-chrome-developer.html This allowed me to see and manage my app's CEF windows through localhost:XXXX.

                  2. I used both Winium and Selenium to test my app. Winium for all my WPF windows and selenium for all my CEF windows. My GUI test starts with Winium Driver to open my app and navigate WPF windows. Each time I need to debug a CEF window, I'm opening a Chrome Driver using selenium with the "remote-debugging-port" argument, which allows me to click elements inside that window. When I'm finish with this chromium window I'm closing the selenium driver and continues with Winium.

                  Use Selenium and Winium with IntelliJ IDEA

                  Selenium is a portable framework for testing and automating web applications. Winium is a Selenium-based tool for testing and automating desktop applications on Windows. In order to use these modules inside IntelliJ IDEA project, follow these steps:

                  1. Download selenium-server-standalone jar file (e.g. selenium-server-standalone-3.141.59.jar) https://www.seleniumhq.org/download/
                  2. Download winium-webdriver jar file (e.g. winium-webdriver-0.1.0-1.jar) http://central.maven.org/maven2/com/github/2gis/winium/winium-webdriver/0.1.0-1/
                  3. Add both jars to your project structure: File → Project Structure → Dependencies → +
                  4. Now all Selenium and Winium imports should work. For example:

                    import org.openqa.selenium.By;
                    import org.openqa.selenium.WebDriver;
                    import org.openqa.selenium.chrome.ChromeDriver;
                    import org.openqa.selenium.chrome.ChromeOptions;
                    import org.openqa.selenium.support.ui.ExpectedConditions;
                    import org.openqa.selenium.support.ui.WebDriverWait;
                    import org.openqa.selenium.winium.DesktopOptions;
                    import org.openqa.selenium.winium.WiniumDriver;
                    import org.openqa.selenium.winium.WiniumDriverService;
                    

                  Use ChromeDriver with Selenium

                  Follow these steps:

                  1. Install the Java JDK and add its bin directory to your system PATH variable.
                  2. Create a directory that will contain all files. This tutorial uses c: emp.
                  3. Download ChromeDriver and extract it (e.g. chromedriver_win32.zip provides chomedriver.exe) https://sites.google.com/a/chromium.org/chromedriver/downloads
                  4. Download selenium-server-standalone-X.X.X-alpha-1.zip (e.g. selenium-server-standalone-4.0.0-alpha-1.zip) http://selenium-release.storage.googleapis.com/index.html
                  5. Download a CEF binary distribution client from Cefbuilds and extract (e.g. cef_binary_76.1.13+gf19c584+chromium-76.0.3809.132_windows64.tar.bz2) http://opensource.spotify.com/cefbuilds/index.html
                  6. Your directory structure should now look similar to this:

                  c:	emp
                    cef_binary_3.2171.1979_windows32_client
                      Release
                        cefclient.exe  (and other files)
                    chromedriver.exe
                    Example.java
                    selenium-server-standalone-2.44.0.jar
                  

                  For more information you can read this wiki: https://bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md

                  Use WiniumDriver with Winium

                  Follow these steps:

                  1. Download the Winium.Desktop.Driver.zip and extract it to c: emp https://github.com/2gis/Winium.Desktop/releases

                  Java Code Example

                  Start a winium driver and open your app:

                  DesktopOptions desktopOption = new DesktopOptions();
                  desktopOption.setApplicationPath("Path_to_your_app.exe");
                  File drivePath = new File("C:\temp\Winium.Desktop.Driver.exe");
                  WiniumDriverService service = new WiniumDriverService.Builder().usingDriverExecutable(drivePath).usingPort(9999).withVerbose(true).withSilent(false).buildDesktopService();
                  service.start();
                  WiniumDriver winiumDriver = WiniumDriver(service, desktopOption);
                  

                  Navigate and test WPF windows using winium. For example:

                  winiumDriver.findElement(By.id("someElementID")).click();
                  

                  Create a ChromeOptions object which holds all needed selenium information such as chromium client and remote debugging port. Make sure to change the "XXXX" port to your remote debugging port.

                  System.setProperty("webdriver.chrome.driver", "c:/temp/chromedriver.exe");
                  ChromeOptions chromeOptions = new ChromeOptions();
                  chromeOptions.setBinary("c:/temp/cef_binary_76.1.13+gf19c584+chromium-76.0.3809.132_windows64_client/Release/cefclient.exe");
                  chromeOptions.addArguments("remote-debugging-port=XXXX");
                  

                  Open a chrome driver (selenium) using the chrome options object.

                  WebDriver seleniumDriver = ChromeDriver(chromeOptions);
                  

                  Use element inside the chromium windows. For example:

                  seleniumWait.until(ExpectedConditions.visibilityOfElementLocated(By.className("someButtonClassName")));
                  seleniumDriver.findElement(By.className("someButtonClassName")).click();
                  

                  When you're done with the CEF window, close selenium driver and continue with the winium driver:

                  seleniumDriver.quit();
                  winiumDriver.findElement(By.id("someElementID")).click();
                  

                  Close main winium driver:

                  winiumDriver.quit();
                  

                  這篇關于“Chrome Legacy Window"的自動化(鉻)使用 Winium的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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?)
                  <legend id='3WW7Z'><style id='3WW7Z'><dir id='3WW7Z'><q id='3WW7Z'></q></dir></style></legend>

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

                      <bdo id='3WW7Z'></bdo><ul id='3WW7Z'></ul>

                      <small id='3WW7Z'></small><noframes id='3WW7Z'>

                        <tfoot id='3WW7Z'></tfoot>
                              <tbody id='3WW7Z'></tbody>
                            主站蜘蛛池模板: 99精品免费视频 | 国产日韩欧美 | 日本黄色的视频 | 青青草亚洲 | 亚洲视频一区二区三区 | 久草青青草 | 亚洲精品久久久久久宅男 | 黄色大片免费网站 | 日本 欧美 国产 | 国产成人一区二 | 国产日日操 | 日韩不卡在线观看 | 日韩欧美不卡 | 久久国产精品精品国产色婷婷 | 精品福利在线 | 午夜在线免费观看视频 | 欧美精品久久久 | 欧美激情在线一区二区三区 | 操操操av | 国产清纯白嫩初高生视频在线观看 | 日韩欧美一区二区三区 | 播放一级毛片 | 国产一区二区三区四区五区加勒比 | 国产成人免费视频网站视频社区 | 在线视频 亚洲 | 色av一区二区三区 | 日韩精品一区二区在线观看 | 国产视频在线观看一区二区三区 | 亚洲综合首页 | 久久www免费视频 | 欧美在线亚洲 | 超碰免费在线观看 | 成人国内精品久久久久一区 | 午夜精品一区二区三区免费视频 | 欧美日韩在线成人 | 一区二区av | 欧美精品成人影院 | 99色视频| 成人在线观看欧美 | 97精品国产手机 | 在线观看中文字幕 |