Is this right working properly with webdriver?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Is this right working properly with webdriver?

Postby Jongkeun » Mon Feb 24, 2020 8:49 pm

Hello.
I've followed steps of https://bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver.md
It seemed to work well. But actually not happened anything in the cefclient application.
The cefclient was keeping the initialized google page.
Maybe I think the page was initialized by the cef application, not by selenium.

standalone server is 3.9.1
chrome driver is 79.0.3945.36

This is my Example.java code
Code: Select all
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class Example {
  public static void main(String[] args) {
    // Path to the ChromeDriver executable.
    System.setProperty("webdriver.chrome.driver", "d:/temp/chromedriver.exe");

    ChromeOptions options = new ChromeOptions();
    // Path to the CEF executable.
     options.setBinary(
     "D:/temp/cef_binary_79.1.36+g90301bd+chromium-79.0.3945.130_windows32_client/Release/cefclient.exe");
    // Port to communicate on. Required starting with ChromeDriver v2.41.
    options.addArguments("remote-debugging-port=12345");

    WebDriver driver = new ChromeDriver(options);
    driver.get("http://www.google.com/xhtml");
    sleep(3000);  // Let the user actually see something!
    WebElement searchBox = driver.findElement(By.name("q"));
    searchBox.sendKeys("ChromeDriver");
    searchBox.submit();
   System.out.println("hello");
    sleep(3000);  // Let the user actually see something!
    driver.quit();

  }

  static void sleep(int time) {
    try {
      Thread.sleep(time);
    } catch (InterruptedException e) {
    }
  }
}


This is my PowerShell log.
Code: Select all
PS D:\temp> javac -cp ".;*" Example.java
PS D:\temp> java -cp ".;*" Example
Starting ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}) on port 6477
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1582593880.143][WARNING]: Timed out connecting to Chrome, retrying...
2월 25, 2020 10:24:42 오전 org.openqa.selenium.remote.ProtocolHandshake createSession
info: Detected dialect: W3C
hello


I add hello log to check if searchBox.submit(); is worked or not.
Nothing has happened since the log appeared.
I expected the google page of cefclient's would be changed to a searched page "ChromeDriver".
But it doesn't.

Should I do something to do related with remote-debugging-port stuff?
Jongkeun
Newbie
 
Posts: 1
Joined: Mon Feb 24, 2020 12:57 am

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 11 guests