MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

JBrowserDriver() constructor seems to hang in initClasspath() #348

Closed PredatorVI closed 5 years ago

PredatorVI commented 5 years ago

I'm trying to run JBrowser v1.1.0-RC1 with Selenium-java v3.141.59 on Windows 10 with Oracle JDK v 1.8.0_211 and I can't seem to even instantiate the driver.

I pulled the sources from Maven Central and it seems to hang inside the initClasspath() call. Attached is a screenshot of the stack trace after pausing the process. Eventually I see a timeout error: Refused to connect. Is there something else that needs to be configured that I missed?

image

pstonebu commented 4 years ago

You ever get this working? I'm having the exact same issue.

PredatorVI commented 4 years ago

I did, but I can't recall the specifics given the time that has passed. I know that I went back to a slightly older version (not the RCx versions). The version I'm using is:

        <dependency>
            <groupId>com.machinepublishers</groupId>
            <artifactId>jbrowserdriver</artifactId>
            <version>1.0.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-server</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-remote-driver</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

And this is the code I'm currently using to instantiate it:

                Settings dcJBrowser = Settings.builder()
                        .userAgent(UserAgent.CHROME)
                        .headless(true)
                        .ssl("trustanything")
                        .hostnameVerification(false)
                        .loggerLevel(Level.ALL)
                        .logJavascript(true)
                        .processes(30)
                        .javaOptions("-Dprism.verbose=true", "-Dprism.useFontConfig=false")
                        .build();
                JBrowserDriver jbrowser = new JBrowserDriver(dcJBrowser);