Example usage for org.openqa.selenium WebDriver getTitle

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

Introduction

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

Prototype

String getTitle();

Source Link

Document

Get the title of the current page.

Usage

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_Title_Health_Check(WebDriver driver) {

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "Free Magento Security Audit & Health Check";
    assertEquals(expectedTitle, actualTitle);
    System.out.println("Title is correct");

}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_Title_link_Portfolio(WebDriver driver) {

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "IWD Agency's Portfolio";
    assertEquals(expectedTitle, actualTitle);
    System.out.println("Title is correct");

    String currentURL = driver.getCurrentUrl();
    System.out.println(currentURL);
    String expectedcurrentURL = "https://www.iwdagency.com/portfolio";
    assertEquals(currentURL, expectedcurrentURL);
    System.out.println("Link is correct https://www.iwdagency.com/portfolio");

}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_Title_link_Blog(WebDriver driver) {

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "IWD Blog | Magento eCommerce Marketing & Related News | IWD Agency's Blog";
    assertEquals(expectedTitle, actualTitle);
    System.out.println("Title is correct");

    String currentURL = driver.getCurrentUrl();
    System.out.println(currentURL);
    String expectedcurrentURL = "https://www.iwdagency.com/blog/";
    assertEquals(currentURL, expectedcurrentURL);
    System.out.println("Link is correct https://www.iwdagency.com/blog");

}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_Title_link_Checkout_suite(WebDriver driver) {

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "Magento One Step & Page Checkout Extension";
    assertEquals(actualTitle, expectedTitle);
    System.out.println("Title is correct");

    String currentURL = driver.getCurrentUrl();
    System.out.println(currentURL);
    String expectedcurrentURL = "https://www.iwdagency.com/extensions/one-step-page-checkout.html";
    assertEquals(currentURL, expectedcurrentURL);
    System.out.println("Link is correct https://www.iwdagency.com/extensions/one-step-page-checkout.html");

}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_title_link_b2b(WebDriver driver) {

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "Magento B2B eCommerce Extension | Wholesale Software";
    assertEquals(actualTitle, expectedTitle);
    System.out.println("Title is correct");

    String currentURL = driver.getCurrentUrl();
    System.out.println(currentURL);
    String expectedcurrentURL = "https://www.iwdagency.com/extensions/b2b-wholesale-suite.html";
    assertEquals(currentURL, expectedcurrentURL);
    System.out.println("Link is correct https://www.iwdagency.com/extensions/b2b-wholesale-suite.html");

}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_guides_button_b2b(WebDriver driver) {

    driver.findElement(By.cssSelector("div[class='demos-guides-link'] button[class='demos-guides-button']"))
            .click();/*from  w ww.j  a  v  a  2  s.  co  m*/
    String user_guide = driver.findElement(By.cssSelector(
            "li[class='link-button user-guide'] a[href='https://www.iwdagency.com/help/m2-b2b-suite/b2b-suite-2-settings']"))
            .getText();
    System.out.println(user_guide);
    String expected_user_guide = "User Guide";
    assertEquals(user_guide, expected_user_guide);
    System.out.println("user_guide is correct");

    String installation_guide = driver.findElement(By.cssSelector(
            "li[class='link-button install-guide'] a[href='https://www.iwdagency.com/help/general-information/installing-iwd-extensions']"))
            .getText();
    System.out.println(installation_guide);
    String expected_installation_guide = "Installation Guide";
    assertEquals(installation_guide, expected_installation_guide);
    System.out.println("installation_guide is correct");
    String homePage = driver.getWindowHandle();

    driver.findElement(By.cssSelector(
            "li[class='link-button user-guide'] a[href='https://www.iwdagency.com/help/m2-b2b-suite/b2b-suite-2-settings']"))
            .click();

    Set<String> windows = driver.getWindowHandles();
    //System.out.println(windows.size());

    Iterator iterator = windows.iterator();
    String currentWindowId;

    while (iterator.hasNext()) {
        currentWindowId = iterator.next().toString();
        //System.out.println(currentWindowId);

        if (!currentWindowId.equals(homePage)) {
            driver.switchTo().window(currentWindowId);

            String actualTitle = driver.getTitle();
            System.out.println(actualTitle);
            String expectedTitle = "[M2] B2B Suite Settings - IWD Agency Support Center";
            assertEquals(actualTitle, expectedTitle);
            System.out.println("Title of page is correct");

            String b2b_suite_settings = driver.findElement(By.cssSelector(".header-title")).getText();
            System.out.println(b2b_suite_settings);
            String expected_b2b_suite_settings = "[M2] B2B Suite Settings";
            assertEquals(b2b_suite_settings, expected_b2b_suite_settings);
            System.out.println("[M2] B2B Suite Settings is correct");

            driver.findElement(By.cssSelector("a[href='#DefaultSettings']"));
            driver.findElement(By.cssSelector("a[href='#Access']"));
            driver.findElement(By.cssSelector("a[href='#Registration']"));
            driver.findElement(By.cssSelector("a[href='#Requester']"));
            driver.findElement(By.cssSelector("a[href='#Notifications']"));
            driver.findElement(By.cssSelector("a[href='#Tables']"));
            driver.findElement(By.cssSelector("a[href='#Download']"));
            driver.findElement(By.cssSelector("a[href='#Order']"));
            driver.findElement(By.cssSelector("a[href='#Account']"));
            driver.findElement(By.cssSelector("a[href='#Credit']"));
            driver.findElement(By.cssSelector("a[href='#Guest']"));
            driver.findElement(By.cssSelector("a[href='#Matrix']"));

            driver.close();
            driver.switchTo().window(homePage);
            driver.findElement(By.cssSelector("div[class=\"md-content es-wrapper\"] a[class=\"close\"]"))
                    .click();
            System.out.println("Test Verify_guides_button_b2b is done");

        }
    }
}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_installation_guide_button_b2b(WebDriver driver) {

    String homePage2 = driver.getWindowHandle();

    driver.findElement(By.cssSelector("div[class='demos-guides-link'] button[class='demos-guides-button']"))
            .click();//from   w  w w  .j  a v a2  s  . c o m
    driver.findElement(By.cssSelector(
            "li[class='link-button install-guide'] a[href='https://www.iwdagency.com/help/general-information/installing-iwd-extensions']"))
            .click();
    Set<String> windows2 = driver.getWindowHandles();
    //System.out.println(windows.size());

    Iterator iterator2 = windows2.iterator();
    String currentWindowId2;

    while (iterator2.hasNext()) {
        currentWindowId2 = iterator2.next().toString();
        //System.out.println(currentWindowId);

        if (!currentWindowId2.equals(homePage2)) {
            driver.switchTo().window(currentWindowId2);

            String actualtitle_Installing = driver.getTitle();
            System.out.println(actualtitle_Installing);
            String expectedtitle_Installing = "Installing IWD Extensions - IWD Agency Support Center";
            assertEquals(actualtitle_Installing, expectedtitle_Installing);
            System.out.println("Title of page Installing is correct");

            String installing_iwd_extensions = driver.findElement(By.cssSelector(".header-title")).getText();
            System.out.println(installing_iwd_extensions);
            String expected_installing_iwd_extensions = "Installing IWD Extensions";
            assertEquals(installing_iwd_extensions, expected_installing_iwd_extensions);
            System.out.println("Installing IWD Extensions is correct");

            driver.findElement(By.cssSelector("a[href='#MAGENTO 1 INSTALLATION']"));
            driver.findElement(By.cssSelector("a[href='#MAGENTO 2 INSTALLATION']"));
            driver.findElement(By.cssSelector("a[href='#ACTIVATING LICENSES']"));
            driver.findElement(By.cssSelector("a[href='/extensions/media/modules/m2/iwd_all.zip']"));
            driver.findElement(By.cssSelector("a[href='/extensions/downloadable/customer/products']"));
            driver.findElement(By
                    .cssSelector("a[href='https://iwdagency.com/help/general-information/installing-iwd-all"));

            driver.close();
            driver.switchTo().window(homePage2);
            driver.findElement(By.cssSelector("div[class=\"md-content es-wrapper\"] a[class=\"close\"]"))
                    .click();

        }
    }
}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_partner_program(WebDriver driver) {

    String homePage = driver.getWindowHandle();
    footer.Click_on_partner_program(driver);
    System.out.println("click on partner_program is done");
    Set<String> windows = driver.getWindowHandles();

    Iterator iterator = windows.iterator();
    String currentWindowId;/*from   www. jav  a2s. co m*/

    while (iterator.hasNext()) {
        currentWindowId = iterator.next().toString();
        if (!currentWindowId.equals(homePage)) {
            driver.switchTo().window(currentWindowId);
        }
    }

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "IWD_Partner_Program.pdf";
    assertEquals(expectedTitle, actualTitle);
    System.out.println("Title is correct");

    String currentURL = driver.getCurrentUrl();
    System.out.println(currentURL);
    String expectedcurrentURL = "https://www.iwdagency.com/extensions/IWD_Partner_Program.pdf";

    assertEquals(currentURL, expectedcurrentURL);
    System.out.println("Link is correct https://www.iwdagency.com/extensions/IWD_Partner_Program.pdf");

    driver.findElement(By.cssSelector(".textLayer"));
    System.out.println("PDF was found");

    driver.close();
    driver.switchTo().window(homePage);

}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_privacy_policy(WebDriver driver) {

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "Privacy Policy | Magento eCommerce Marketing & Related News";
    assertEquals(expectedTitle, actualTitle);
    System.out.println("Title is correct");

    String currentURL = driver.getCurrentUrl();
    System.out.println(currentURL);
    String expectedcurrentURL = "https://www.iwdagency.com/privacy-policy-cookie-restriction-mode/";
    assertEquals(currentURL, expectedcurrentURL);
    System.out.println("Link is correct https://www.iwdagency.com/privacy-policy-cookie-restriction-mode/");

    String actualCOOKIE_Name = driver.findElement(By.cssSelector(
            "div[class=\"gw-go-col-wrap gw-go-col-wrap-0 gw-go-disable-enlarge gw-go-disable-hover\"] div[class=\"gw-go-header\"] p"))
            .getText();//from w w w. ja  v  a2  s.c o m
    System.out.println(actualCOOKIE_Name);
    String expectedCOOKIE_Name = "COOKIE Name";
    assertEquals(expectedCOOKIE_Name, actualCOOKIE_Name);
    System.out.println("COOKIE_Name is correct");

    String actualCOOKIE_Description = driver.findElement(By.cssSelector(
            "div[class=\"gw-go-col-wrap gw-go-col-wrap-1 gw-go-disable-enlarge gw-go-disable-hover\"] div[class=\"gw-go-header\"] p"))
            .getText();
    System.out.println(actualCOOKIE_Name);
    String expectedCOOKIE_Description = "COOKIE Description";
    assertEquals(expectedCOOKIE_Description, actualCOOKIE_Description);
    System.out.println("COOKIE_Description is correct");

    driver.findElement(By.cssSelector(
            ".vc_general.vc_btn3.vc_btn3-size-lg.vc_btn3-shape-square.vc_btn3-style-custom.typeform-share.link"))
            .click();

}

From source file:IWDmainsiteProject.PageObjects.Verify_Pages.java

public static void Verify_terms_conditions(WebDriver driver) {

    String actualTitle = driver.getTitle();
    System.out.println(actualTitle);
    String expectedTitle = "Terms & Conditions - Magento eCommerce Solutions | Interior Web Design";
    assertEquals(expectedTitle, actualTitle);
    System.out.println("Title is correct");

    String currentURL = driver.getCurrentUrl();
    System.out.println(currentURL);
    String expectedcurrentURL = "https://www.iwdagency.com/terms-and-conditions/";
    assertEquals(currentURL, expectedcurrentURL);
    System.out.println("Link is correct https://www.iwdagency.com/terms-and-conditions/");

    driver.findElement(By.cssSelector(// w w w .java 2 s.c  om
            ".vc_general.vc_btn3.vc_btn3-size-lg.vc_btn3-shape-square.vc_btn3-style-custom.typeform-share.link"))
            .click();

}