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

無法使用 selenium 網絡驅動程序連接到電子/CEF 應

Unable to connect to the electron / CEF app using selenium web driver(無法使用 selenium 網絡驅動程序連接到電子/CEF 應用程序)
本文介紹了無法使用 selenium 網絡驅動程序連接到電子/CEF 應用程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試使用此示例代碼自動化 [electron-api-demos][1]app.

I am trying to automate [electron-api-demos][1]app using this sample code.

  public static void main(String args[]) throws IOException, InterruptedException {
        int port = 9223;// Open App

          Runtime.getRuntime().exec(
          "C:\Program Files\Sample.exe"
          , null, new
          File("C:\Program Files\Sample"
          ));

         ChromeOptions options = new ChromeOptions();
        String remoteDebuggingAddress = "localhost:" + port;
        options.setExperimentalOption("debuggerAddress", remoteDebuggingAddress);
        options.addArguments("remote-debugging-port=9223");

        // options.addArguments("electron-port="+port);
        options.setBinary(
                "C:\Program Files\Sample.exe");

        System.setProperty("webdriver.chrome.driver",
                "C:\Users\narays24\eclipse-workspace\xyz\src\demo1\chromedriver.exe");
        WebDriver driver = new ChromeDriver(options);
        System.out.println(driver.getTitle());

        String location = "C:\Users\narays24\eclipse-workspace\xyz\src\demo1";
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy");
        String time = dateFormat.format(now);
        File dir = new File(location + time);

        if (!dir.exists())
        {
            dir.mkdir();
        }
        else
        {
            //System.out.println("directory already exists");
            //Do nothing
        }

        File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
        try {
            FileUtils.copyFile(scrFile, new File(location + time + "\screen1.png"));
            }
        catch (IOException e)
             {
              System.out.println(e.getMessage());

             }

    }

我可以訪問該應用程序并獲取屏幕截圖.我無法通過以下端口訪問 cef:

I am able to access the app and get a screenshot. I am not able to access the cef through the below port :

http://localhost:9223/

我在 localhost 得到以下內容,但不是元素:

I am getting the following at the localhost , but not the elements :

可檢查的 WebContents 掃描儀ui/appfiles/index.html

Inspectable WebContents scannerui/appfiles/index.html

誰能幫我理解我哪里出錯了.將 selenium 更改為 alpha 后,我可以毫無錯誤地運行它.

Can anyone help me understand where I am going wrong. After changing the selenium to alpha , I am able to run this with out errors .

更新

我能夠導航到 google 并在 cef 中實現自動化.但我無法控制或對應用程序的菜單欄或按鈕或文本框執行任何操作.

I am able to navigate to google and automate in cef . But I am not able to control or perform any actions on application's menu bar or buttons or text boxes.

我的 cef 基于 chrome 57 .所以我將 chrome 瀏覽器降級為 57 ,將 chrome 驅動程序降級為 2.26 ,將 selenium Java 庫降級為 2.36 .

My cef is based on chrome 57 .so I downgraded the chrome browser to 57 , chrome driver to 2.26 and selenium Java libraries to 2.36 .

我仍然無法單擊桌面應用程序特定的按鈕或文本框.但我能夠驅動程序.導航到谷歌并執行測試.

Still I am not able to click on desktop application specific buttons or text boxes. But am able to driver.navigate to google and perform tests.

有人可以幫忙嗎?我正在使用 Java ,硒

Can anyone help here? I am using Java , selenium

我也試過上面提到的電子申請,還是沒有運氣

I also tried on electron application as mentioned above, still no luck

推薦答案

@DebanjanB,謝謝您的幫助.將 selenium 的版本更改為 alpha 后,我可以無錯誤地連接到應用程序.我現在正在使用以下代碼:

@DebanjanB, Thanks for the help. After I changed the version of the selenium to alpha , I am able to connect to the app with out errors. I am using the following code now :

public static void main(String args[]) throws IOException, InterruptedException {
        int port = 9223;
        // Open App

        Runtime.getRuntime().exec(
                "C:\Program Files\SampleApp.exe", null,
                new File("C:\Program Files\SampleApp"));

        ChromeOptions options = new ChromeOptions();
        String remoteDebuggingAddress = "localhost:" + port;
        options.setExperimentalOption("debuggerAddress", remoteDebuggingAddress);
        options.addArguments("remote-debugging-port=9223");
        options.setBinary(
                "C:\Program Files\SampleApp.exe");

        System.setProperty("webdriver.chrome.driver",
                "C:\Users\xyz\eclipse-workspace\xyz\src\demo1\chromedriver.exe");
        WebDriver driver = new ChromeDriver(options);
        System.out.println(driver.getTitle());

    }

問題是我無法在 http://localhost:9223/ 訪問 chromium 中的元素當我在本地主機上打開 chromium 或 chrome 瀏覽器時,會顯示以下文本.通常需要一個鏈接.鏈接或 WebElement 不顯示.

The issue is I am not able to access the elements in chromium at http://localhost:9223/ When I open the chromium or chrome browser at teh local host the following text is displayed . Normally a link is expected . Link or the WebElements are not displayed.

可檢查的 WebContents 掃描儀ui/appfiles/index.html

Inspectable WebContents scannerui/appfiles/index.html

這篇關于無法使用 selenium 網絡驅動程序連接到電子/CEF 應用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(Google 驅動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅動api服務賬戶查看上傳文件到谷歌驅動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
主站蜘蛛池模板: 国产日韩一区二区三区 | 亚洲黄色网址视频 | 久久中文字幕一区 | 国产精品久久久久aaaa樱花 | 天天亚洲 | 91正在播放 | 精品久久久久久久久久久久久久 | 亚洲一二三区不卡 | 成人性生交大片免费看中文带字幕 | 免费观看色 | 亚洲精品在线免费看 | 一区二区三区四区在线 | 午夜精品一区二区三区在线观看 | 亚洲综合精品 | 毛片一区二区 | 久久大 | 91视频91| 狠狠伊人 | h片在线播放 | 久久成人av电影 | 91免费观看在线 | 日韩在线免费 | 99精品免费 | 国产精品久久久乱弄 | 中文字幕精品一区久久久久 | 网站一区二区三区 | 99re66在线观看精品热 | www.99re| 欧美精三区欧美精三区 | 成人午夜激情 | 中文字幕一区在线观看视频 | 色五月激情五月 | 欧美成人a∨高清免费观看 色999日韩 | 国产美女福利在线观看 | 国产不卡一区在线观看 | 在线成人av | 日韩免费高清视频 | 精品视频一区二区三区 | 成年视频在线观看福利资源 | 国产精品高潮呻吟久久aⅴ码 | 久久久久久久久久久久91 |