Example usage for org.openqa.selenium WebDriver getCurrentUrl

List of usage examples for org.openqa.selenium WebDriver getCurrentUrl

Introduction

In this page you can find the example usage for org.openqa.selenium WebDriver getCurrentUrl.

Prototype

String getCurrentUrl();

Source Link

Document

Get a string representing the current URL that the browser is looking at.

Usage

From source file:org.wso2.am.integration.ui.tests.pages.publisher.PublisherLoginPage.java

License:Open Source License

public PublisherLoginPage(WebDriver driver) {
    super(driver);
    this.driver = driver;
    // Check that we're on the right page.
    if (!(driver.getCurrentUrl().contains(APIMTestConstants.PUBLISHER_LOGIN_PAGE_URL_VERIFICATION))) {
        throw new IllegalStateException("This is not the publisher login page");
    }//  w w  w. j a v a2s . c o m
}

From source file:org.wso2.am.integration.ui.tests.pages.store.StoreHomePage.java

License:Open Source License

public StoreHomePage(WebDriver driver) throws IOException {
    super(driver);
    this.driver = driver;

    // Check that we're on the right page.
    if (!(driver.getCurrentUrl().contains(APIMTestConstants.STORE_HOME_PAGE_URL_VERIFICATION))) {
        throw new IllegalStateException("This is not the Store Home page");
    }/*  ww  w. jav a  2 s  . c  o m*/
}

From source file:org.wso2.appmanager.ui.integration.test.pages.LoginPage.java

License:Open Source License

private LoginPage(WebDriver driver, AutomationContext appMServer) throws IOException {
    this.driver = driver;
    this.appMServer = appMServer;
    //check that we are on the correct page
    if (!(driver.getCurrentUrl().contains("/login.do"))) {
        throw new IllegalStateException("This is not " + this.getClass().getSimpleName());
    }/*from w  w w  .ja  va2 s.  c  o m*/
}

From source file:org.wso2.appmanager.ui.integration.test.pages.PublisherCreateWebAppPage.java

License:Open Source License

private PublisherCreateWebAppPage(WebDriver driver, AutomationContext appMServer) throws IOException {
    this.driver = driver;
    this.appMServer = appMServer;
    //check that we are on the correct page
    if (!(driver.getCurrentUrl().contains(PAGE))) {
        throw new IllegalStateException("This is not " + this.getClass().getSimpleName());
    }/*ww  w  .  j  ava2 s  . c o m*/
}

From source file:org.wso2.appmanager.ui.integration.test.pages.PublisherOverviewWebAppPage.java

License:Open Source License

private PublisherOverviewWebAppPage(WebDriver driver, AutomationContext appMServer) throws IOException {
    this.driver = driver;
    this.appMServer = appMServer;
    //check that we are on the correct page
    if (!(driver.getCurrentUrl().contains(PAGE))) {
        throw new IllegalStateException("This is not " + this.getClass().getSimpleName());
    }//from  w  ww. jav  a  2  s.c  o  m
}

From source file:org.wso2.appmanager.ui.integration.test.pages.PublisherWebAppsListPage.java

License:Open Source License

private PublisherWebAppsListPage(WebDriver driver, AutomationContext appMServer) throws IOException {
    this.driver = driver;
    this.appMServer = appMServer;
    //check that we are on the correct page
    if (!(driver.getCurrentUrl().contains(PAGE))) {
        throw new IllegalStateException("This is not " + this.getClass().getSimpleName());
    }//ww w  . jav  a  2s  .  c  o  m
}

From source file:org.wso2.appmanager.ui.integration.test.pages.StoreHomePage.java

License:Open Source License

private StoreHomePage(WebDriver driver, AutomationContext appMServer) throws IOException {
    this.driver = driver;
    this.appMServer = appMServer;
    //check that we are on the correct page
    if (!(driver.getCurrentUrl().contains(PAGE))) {
        throw new IllegalStateException("This is not " + this.getClass().getSimpleName());
    }/*from ww w .  j  a  va 2s. com*/
}

From source file:org.wso2.appserver.integration.common.ui.page.LoginPage.java

License:Open Source License

public LoginPage(WebDriver driver) throws IOException {
    this.driver = driver;

    // Check that we're on the right page.
    if (!(driver.getCurrentUrl().contains("login.jsp"))) {
        // Alternatively, we could navigate to the login page, perhaps logging out first
        throw new IllegalStateException("This is not the login page");
    }/*from  w  ww  .  ja v a2s .  c  o  m*/
}

From source file:org.wso2.appserver.integration.common.ui.page.LoginPage.java

License:Open Source License

public LoginPage(WebDriver driver, boolean isCloudEnvironment) throws IOException {
    this.driver = driver;
    this.isCloudEnvironment = isCloudEnvironment;
    // Check that we're on the right page.
    if (this.isCloudEnvironment) {
        if (!(driver.getCurrentUrl().contains("home/index.html"))) {
            // Alternatively, we could navigate to the login page, perhaps logging out first
            throw new IllegalStateException("This is not the cloud login page");
        }//from w w  w . ja v  a 2 s.c  o  m
        driver.findElement(By.xpath("//*[@id=\"content\"]/div[1]/div/a[2]/img")).click();
    } else {
        if (!(driver.getCurrentUrl().contains("login.jsp"))) {
            // Alternatively, we could navigate to the login page, perhaps logging out first
            throw new IllegalStateException("This is not the product login page");
        }
    }
}

From source file:org.wso2.bps.integration.ui.pages.login.LoginPage.java

License:Open Source License

public LoginPage(WebDriver driver) throws IOException {
    this.driver = driver;
    // Check that we're on the right page.
    if (!(driver.getCurrentUrl().contains("login.jsp"))) {
        // Alternatively, we could navigate to the login page, perhaps logging out first
        throw new IllegalStateException("This is not the login page");
    }/*from   w w  w . ja va 2  s . c om*/
}