2

Using Selenium webdriver I am trying to test a web application and my test is to Login to the web application, Once logged-in, on the left-hand menu panel I need to click on a parent and that will show the child link and when I click the child link it has to take me to a page and on the page I have to validate some fields.

When I tried to perform this test the test is failing immediately after I logged-in to the website. Please help me.

@Test(priority = 0)
    public void Login_To_ControlRoom() throws Exception {

        loginPage = new LoginPage(driver);

        String loginUserName = BaseTest.propertyName("usrName_Admin1");
        String loginPassword = BaseTest.propertyName("usrPassword_Admin1");

        softAssert.assertAll();
        navigationlinks = loginPage.doLogin(loginUserName, loginPassword);

        Assert.assertTrue(navigationlinks.loggedInUserStatus(), "User Not loggedin successfully");

        navigationlinks.accessAdministration();
        licensePage = navigationlinks.clickAdministrationLicenses();
        installLicensePage = licensePage.clickInstallLicense();

        Assert.assertFalse(installLicensePage.isInstallLicenseBtnEnabled(), "Install License button is enabled");
    }   
Sridhar
  • 1,832
  • 3
  • 23
  • 44
SKV
  • 133
  • 1
  • 3
  • 14
  • What error is being thrown when your test fails after login? Could you share the code for `navigationlinks.loggedInUserStatus()`? – Mahipal May 29 '17 at 05:48
  • Please consider adding more details. e.g.: exception encountered, which line causes the failure. Also please consider exposing or explaining objects that doesnt have visibility on your current code: navigationlink, BaseTest... – iamkenos May 29 '17 at 06:16
  • After implementing a class to initialize the WebDriver and extending the newly created class to all other page classes solved the problem and now my test is passing. I hope that is a correct solution what you guys feel. – SKV May 29 '17 at 07:04

1 Answers1

0

After implementing a class to initialize the WebDriver and extending the newly created class to all other page classes that solved the problem and now my test is passing.

SKV
  • 133
  • 1
  • 3
  • 14