Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

NullPointerException on login in Selenium gradle project #332

Closed
sudheerah opened this issue Jun 19, 2019 · 6 comments
Closed

NullPointerException on login in Selenium gradle project #332

sudheerah opened this issue Jun 19, 2019 · 6 comments
Labels

Comments

@sudheerah
Copy link

sudheerah commented Jun 19, 2019

Environment

Bobcat version: 2.0.3

Gradle wrapper

------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------

Build time:   2018-04-18 09:09:12 UTC
Revision:     b9a962bf70638332300e7f810689cb2febbd4a6c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_181 (Oracle Corporation 25.181-b13)
OS:           Windows 10 10.0 amd64

Bobcat modules used:

  • bb-aem-classic
  • bb-aem-common
  • bb-annotations
  • bb-core
  • bb-cumber
  • bb-junit
  • bb-reports

Browser + version: Chrome 74.0.3729.169

Expected Behavior

Login to AEM

Actual Behavior

Nullpointer exception with below error

Steps to reproduce

I am getting below error when trying to login (button click). Page loading correctly though. The error occurring in below executing line

code :

 @Given("^I login to AEM$")
    public void I_have_opened_login_page() throws ActionException {
        controller.execute(AemActions.LOG_IN);
    }

Error:

abc.RunTests > Plan Long Description functional test cases.Validate if author can change the text color STANDARD_OUT
        Given I login to AEM                                                                                     # CommonSteps.I_have_opened_login_page()
          java.lang.NullPointerException
        at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions.addCookie(RemoteWebDriver.java:681)
        at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringOptions.addCookie(EventFiringWebDriver.java:615)
        at com.cognifide.qa.bb.aem.core.login.actions.LogIn.execute(LogIn.java:59)
        at com.cognifide.qa.bb.api.actions.internal.DefaultController.execute(DefaultController.java:49)
        at abc.steps.CommonSteps.I_have_opened_login_page(CommonSteps.java:32)

And the other interesting thing is in the reports under the standard error it shows below. But as per my readings it's a informational message: Answer

Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 11718
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Jun 19, 2019 10:20:09 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
com.cognifide.qa.bb.aem.core.pages.AemPageManipulationException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.cognifide.qa.bb.aem.core.pages.sling.DeletePage.execute(DeletePage.java:59)
    at com.cognifide.qa.bb.aem.core.pages.sling.DeletePage.execute(DeletePage.java:42)
    at com.cognifide.qa.bb.api.actions.internal.DefaultController.execute(DefaultController.java:55)
    at abc.steps.CommonSteps.tearDown(CommonSteps.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method

ChromerDriver : chromedriver_74.0.3729.6 this is match with chrome browser version

Further I am using domain name url to login to AEM e.g. https://author1.test.abc.adobecqms.net. If I use ip and port can't even get into the page.

@DeChrish
Copy link

@sudheerah pl share the github repo.

@sudheerah
Copy link
Author

Hey DeChris, Please see attached file for your investigation
BobcatAutomation.zip

@DeChrish
Copy link

DeChrish commented Jul 5, 2019

@sudheerah - I am able to login with the above code. Only difference is the login and password. Your password has some special characters, i am not sure cookie injection accepts these spl character.

@DeChrish
Copy link

@Shaihuludus / @mkrzyzanowski pl close this ticket

@mkrzyzanowski
Copy link
Contributor

The mechanism works correctly, although it does poor job informing you about potential problems (i.e. spits out NPE). I've included a small bugfix in #337

@mkrzyzanowski
Copy link
Contributor

Released in 2.1.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants