0

I have a selenium script as below:

public class firstclass {   
    public static void main(String[] args) throws MalformedURLException {
    new DesiredCapabilities();
    DesiredCapabilities cap = DesiredCapabilities.chrome();
    URL url = new URL("http://192.168.99.100:4443/wd/hub");
    RemoteWebDriver rwd = new RemoteWebDriver(url, cap);
    rwd.get("https://www.google.com");
    try {   Thread.sleep(1500); } catch (InterruptedException e) {  e.printStackTrace(); }
    System.out.println("Title of the page : "+rwd.getTitle());
    rwd.quit();         
    }
 } 

This works fine when I run from eclipse. Then I started by Selenium Hub and Chrome containers from docker and here is a result of the docker ps command: image

On my browser , I can see the following. image

I used the VNC viewer from chrome webstore. I tried with different IPs, but still I can't login to the chrome container to view the execution. It keeps saying unable to connect.

Which IP I need to use?

7
  • Docker is exposed in localhost:5555 and localhost:4444 – PDHide Oct 11 '20 at 10:24
  • 1
    Why do you think there should be vnc server? It should be running on a certain port in container which has to be mapped to some external port – Alexey R. Oct 11 '20 at 14:23
  • @PDHide , Thank you but i tried both. it did not work. – user12730187 Oct 11 '20 at 23:06
  • 1
    I mean why do you think it is even possible? Are you following some tutorial? – Alexey R. Oct 12 '20 at 7:20
  • 1
    Assuming you're using the SeleniumHQ images, I think you need to expose port 5900 out to the host? There's some details in the readme.MD – ernie Oct 12 '20 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.