iriusrisk / bdd-security

BDD Automated Security Tests for Web Applications
http://www.continuumsecurity.net/bdd-intro.html
GNU Affero General Public License v3.0
559 stars 177 forks source link

Chromedriver and FirefoxDriver issues #95

Closed ratzrattillo closed 5 years ago

ratzrattillo commented 6 years ago

It seems like neither chromedriver or firefoxdriver (geckodriver) are working properly. when changing the defaultDriver in the config.xml on a Microsoft Windows System: <defaultDriver path="src/test/resources/drivers/chromedriver.exe">Chrome</defaultDriver>

leads to the following:

.\gradlew -Dcucumber.options="--tags @authentication --tags ~@skip"

> Task :test

net.continuumsecurity.junit.SecurityTest > Scenario: Passwords should be case sensitive.Given a new browser or client instance FAILED
    java.lang.RuntimeException: java.lang.NullPointerException

        Caused by:
        java.lang.NullPointerException

net.continuumsecurity.junit.SecurityTest > Scenario: Passwords should be case sensitive.classMethod FAILED
    java.lang.RuntimeException: java.lang.NullPointerException

        Caused by:
        java.lang.NullPointerException

net.continuumsecurity.junit.SecurityTest > Scenario: Present the login form itself over an HTTPS connection.Given a new browser instance FAILED
    java.lang.RuntimeException: java.lang.NullPointerException

        Caused by:
        java.lang.NullPointerException

Changing the driver to geckodriver leads to the following error:

.\gradlew -Dcucumber.options="--tags @authentication --tags ~@skip"

> Task :test

net.continuumsecurity.junit.SecurityTest > Scenario: Passwords should be case sensitive.Given a new browser or client instance FAILED
    java.lang.RuntimeException: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases

        Caused by:
        java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
ratzrattillo commented 6 years ago

Eventually, the following line should be added to DriverFactory.java:

System.setProperty("webdriver.gecko.driver", Config.getInstance().getDefaultDriverPath());

stephendv1 commented 6 years ago

Check whether you need to launch 32 or 64 bit binaries. And check that Windows can understand the path in defaultDriver tag.

jordi-t commented 5 years ago

I am having the same problem here. I would like to use the chromedriver. I see that Chrome is actually getting started, but next the logs are telling me:

23:44:03.746 [DEBUG] [TestEventLogger]     java.lang.RuntimeException: java.lang.NullPointerException
23:44:03.746 [DEBUG] [TestEventLogger]         at net.continuumsecurity.Config.createApp(Config.java:52)
23:44:03.747 [DEBUG] [TestEventLogger]         at net.continuumsecurity.steps.WebApplicationSteps.createApp(WebApplicationSteps.java:77)
23:44:03.747 [DEBUG] [TestEventLogger]         at net.continuumsecurity.steps.WebApplicationSteps.createAppForAnyClient(WebApplicationSteps.java:73)
23:44:03.747 [DEBUG] [TestEventLogger]         at ✽.Given a new browser or client instance(authentication.feature:7)
23:44:03.747 [DEBUG] [TestEventLogger]
23:44:03.747 [DEBUG] [TestEventLogger]         Caused by:
23:44:03.747 [DEBUG] [TestEventLogger]         java.lang.NullPointerException
23:44:03.747 [DEBUG] [TestEventLogger]             at net.continuumsecurity.web.drivers.DriverFactory.createProxyCapabilities(DriverFactory.java:182)
23:44:03.748 [DEBUG] [TestEventLogger]             at net.continuumsecurity.web.drivers.DriverFactory.createProxyDriver(DriverFactory.java:110)
23:44:03.748 [DEBUG] [TestEventLogger]             at net.continuumsecurity.web.drivers.DriverFactory.findOrCreate(DriverFactory.java:94)
23:44:03.748 [DEBUG] [TestEventLogger]             at net.continuumsecurity.web.drivers.DriverFactory.getDriver(DriverFactory.java:64)
23:44:03.748 [DEBUG] [TestEventLogger]             at net.continuumsecurity.web.drivers.DriverFactory.getProxyDriver(DriverFactory.java:54)
23:44:03.748 [DEBUG] [TestEventLogger]             at net.continuumsecurity.web.WebApplication.setImplicitWait(WebApplication.java:58)
23:44:03.748 [DEBUG] [TestEventLogger]             at net.continuumsecurity.web.WebApplication.<init>(WebApplication.java:40)
23:44:03.748 [DEBUG] [TestEventLogger]             at net.continuumsecurity.examples.ropeytasks.RopeyTasksApplication.<init>(RopeyTasksApplication.java:17)
23:44:03.749 [DEBUG] [TestEventLogger]             at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
23:44:03.749 [DEBUG] [TestEventLogger]             at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
23:44:03.749 [DEBUG] [TestEventLogger]             at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
23:44:03.749 [DEBUG] [TestEventLogger]             at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
23:44:03.749 [DEBUG] [TestEventLogger]             at java.base/java.lang.Class.newInstance(Class.java:558)
23:44:03.749 [DEBUG] [TestEventLogger]             at net.continuumsecurity.Config.createApp(Config.java:47)

I'm running the default config.xml from the Master branch, except with the chrome driver enabled.

I'm on MacOS 10.13.4 and tried it with both Java 8 and Java 9 with Chrome Version 67.0.3396.99 (Official Build) (64-bit) and newest chromedriver for mac.

@stephendv1 any idea?

yahi1591 commented 5 years ago

@jseris have you tried with chrome instead Chrome in config.xml? It seems like case sensitive, I had the same problem on MacOS.

jordi-t commented 5 years ago

Thanks @yahi1591 ! That helped 👍