Example usage for org.openqa.selenium.interactions Actions Actions

List of usage examples for org.openqa.selenium.interactions Actions Actions

Introduction

In this page you can find the example usage for org.openqa.selenium.interactions Actions Actions.

Prototype

public Actions(WebDriver driver) 

Source Link

Usage

From source file:com.osbitools.ws.shared.prj.xui.GenericPrjMgrGuiWebTest.java

License:LGPL

public void dragDrop(WebElement from, WebElement to) {
    Actions builder = new Actions(driver);

    Action dragAndDrop = builder.clickAndHold(from).moveToElement(to).release(to).build();

    dragAndDrop.perform();/*  ww  w.  j ava 2  s .c o  m*/
}

From source file:com.osbitools.ws.shared.prj.xui.GenericPrjMgrGuiWebTest.java

License:LGPL

/**
 * Right click on web element and return reference on context menu
 * /*from  ww w  . j  a v a2  s .c  o m*/
 * @param el WebElement
 * @return reference on context menu
 */
public WebElement ctxMenuClick(WebElement el) {
    Actions action = new Actions(driver);
    action.contextClick(el).build().perform();
    WebElement ctx = driver.findElement(By.className("contextMenuPlugin"));
    assertNotNull(ctx);

    return ctx;
}

From source file:com.osbitools.ws.shared.xui.GenericGuiWebTest.java

License:LGPL

public void sendKey(Keys key) {
    Actions action = new Actions(driver);
    action.sendKeys(key).perform();
}

From source file:com.pages.CompanyLoginpage.java

public static void CompanyLogin(WebDriver driver, String Companynumber) throws InterruptedException {
    String url = driver.getCurrentUrl();
    if (URL.equalsIgnoreCase(url)) {
        driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
        common.Wait_Until_ElementVisible(driver, LicenseAgreement_popup);
        driver.findElement(By.xpath("//button[@id='btnEULAAgree']")).click();
        //Thread.sleep(1000);
        driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
    } else {/*from ww  w .j a  v a2 s .  com*/
        driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
        JavascriptExecutor js = (JavascriptExecutor) driver;
        js.executeScript(String.format("window.localStorage.clear();"));
        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
        driver.manage().deleteAllCookies();
        Actions act = new Actions(driver);
        act.sendKeys(Keys.CONTROL.F5).perform();
        driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
        driver.findElement(By.xpath("//button[@id='btnEULAAgree']")).click();
        //Thread.sleep(1000);
        driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
        driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS);

    }

    JavascriptExecutor js = (JavascriptExecutor) driver;
    js.executeScript("return document.readyState").equals("complete");
    //Thread.sleep(1000);
    WebDriverWait ww = new WebDriverWait(driver, 30);
    ww.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(AccessKey_fld_xpath)));
    driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
    driver.findElement(By.xpath(AccessKey_fld_xpath)).sendKeys(Companynumber);
    driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
    driver.findElement(By.xpath(Download_btn_xpath)).click();
    driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS);
    // Thread.sleep(500);
    ww.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(HomePage_NavBar)));
}

From source file:com.pentaho.ctools.cde.reference.AddinReferenceEdit.java

License:Apache License

/**
 *
 * @param value// ww  w. j a  v a  2 s.c o m
 */
private void ChangeFontSize(String value) {
    this.log.info("ChangeFontSize");
    driver.get(PageUrl.ADDIN_REFERENCE_EDIT);

    //Expand first row - Title
    this.elemHelper.ClickJS(driver, By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[5]/td/span"));
    //Click in HTML to open the Properties
    Actions acts = new Actions(driver);
    acts.click(this.elemHelper.FindElement(driver,
            By.xpath("//table[@id='table-cdfdd-layout-tree']/tbody/tr[6]/td[1]")));
    acts.build().perform();
    //Click in field 'Font Size' to be editable
    this.elemHelper.ClickJS(driver, By.xpath("//table[@id='table-cdfdd-layout-properties']/tbody/tr[3]/td[2]"));
    //Write 34
    this.elemHelper.FindElement(driver, By.name("value")).clear();
    this.elemHelper.SendKeys(driver, By.name("value"), value);
    this.elemHelper.FindElement(driver, By.name("value")).submit();
    this.bFontChanged = true;
    //Save the changes
    this.elemHelper.ClickJS(driver, By.linkText("Save"));
    //Wait for element present and invisible
    this.elemHelper.WaitForElementVisibility(driver, By.xpath("//div[@id='notifyBar']"));
    this.elemHelper.WaitForElementInvisibility(driver, By.xpath("//div[@id='notifyBar']"));
}

From source file:com.pentaho.ctools.cde.reference.BulletChartTestCase.java

License:Apache License

/**
 * ############################### Test Case 1 ###############################
 *
 * Test Case Name://from   w  w  w . j  a va 2  s .  co m
 *    PageContent
 * Description:
 *    The test case pretends validate charts presented.
 * Steps:
 *    1. Check chart 1 - No data sent
 *    2. Check chart 2 - Returning one value only (65)
 *    3. Check chart 3 - Returning name and value
 *    4. Check chart 4 - Title, value and marker
 *    5. Check chart 5 - Complete dataset
 */
@Test
public void tc01_ChartContent_DisplayedCorrect() {
    this.log.info("tc01_ChartContent_DisplayedCorrect");

    /*
     * ## Step 0
     */
    //Check page title
    wait.until(ExpectedConditions.titleIs("Bullet chart testcase"));
    assertEquals("Bullet chart testcase", driver.getTitle());
    //Check title
    String title = this.elemHelper.WaitForElementPresentGetText(driver, By.cssSelector("#title > span"));
    assertEquals("Bullet chart test case", title);

    /*
     * ## Step 1
     */
    //Chart 1
    //Check title
    String subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver,
            By.cssSelector("#subtitle1 > span"));
    assertEquals("No data sent", subtitle1);
    //Check serie title and subtitle
    String cht1Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj1']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Title", cht1Title1);
    String cht1Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj1']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("No data", cht1Subtitle1);
    //Check chart
    WebElement cht1SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj1']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht1SizeBar);
    assertEquals("202.11111111111111", cht1SizeBar.getAttribute("width"));
    WebElement cht1RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj1']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    WebElement cht1RectWhite2 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj1']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='path'][2]"));
    assertNotNull(cht1RectWhite1);
    assertNotNull(cht1RectWhite2);
    assertEquals("translate(78.46666666666665,15) ", cht1RectWhite1.getAttribute("transform"));
    assertEquals("translate(156.9333333333333,15) ", cht1RectWhite2.getAttribute("transform"));

    /*
     * ## Step 2
     */
    //Chart 2
    //Check title
    String subtitle2 = this.elemHelper.WaitForElementPresentGetText(driver, By.id("subtitle2"));
    assertEquals("Returning one value only (65)", subtitle2);
    //Check serie title and subtitle
    String cht2Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj2']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Value only", cht2Title1);
    String cht2Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj2']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("value is 65", cht2Subtitle1);
    //Check chart
    WebElement cht2SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj2']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht2SizeBar);
    assertEquals("154.55555555555554", cht2SizeBar.getAttribute("width"));
    WebElement cht2RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj2']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht2RectWhite1);
    assertEquals("translate(71.33333333333333,12.5) ", cht2RectWhite1.getAttribute("transform"));

    /*
     * ## Step 3
     */
    //>Chart 3
    //>>Chart 31
    //Check title
    String subtitle3 = this.elemHelper.WaitForElementPresentGetText(driver, By.id("subtitle3"));
    assertEquals("Returning name and value", subtitle3);
    //Check series title and subtitle
    String cht31Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Atelier graphique", cht31Title1);
    String cht31Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht31Subtitle1);
    //Check chart
    WebElement cht31SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht31SizeBar);
    assertEquals("178.26666666666668", cht31SizeBar.getAttribute("width"));
    WebElement cht31RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht31RectWhite1);
    assertEquals("translate(509.3333333333333,10) ", cht31RectWhite1.getAttribute("transform"));
    //>>Chart 32
    //Check series title and subtitle
    String cht32Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Signal Gift Stores", cht32Title1);
    String cht32Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht32Subtitle1);
    //Check chart
    WebElement cht32SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht32SizeBar);
    assertEquals("609.5022222222223", cht32SizeBar.getAttribute("width"));
    WebElement cht32RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht32RectWhite1);
    assertEquals("translate(509.3333333333333,10) ", cht32RectWhite1.getAttribute("transform"));
    //>>Chart 33
    //Check series title and subtitle
    String cht33Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Australian Collectors, Co.", cht33Title1);
    String cht33Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht33Subtitle1);
    //Check chart
    WebElement cht33SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht33SizeBar);
    assertEquals("764", cht33SizeBar.getAttribute("width"));
    WebElement cht33RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht33RectWhite1);
    assertEquals("translate(390.79283887468034,10) ", cht33RectWhite1.getAttribute("transform"));
    //>>Chart 34
    String cht34Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][4]/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("La Rochelle Gifts", cht34Title1);
    String cht34Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][4]/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht34Subtitle1);
    //Check chart
    WebElement cht34SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][4]/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht34SizeBar);
    assertEquals("764", cht34SizeBar.getAttribute("width"));
    WebElement cht34RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][4]/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht34RectWhite1);
    assertEquals("translate(387.8172588832487,10) ", cht34RectWhite1.getAttribute("transform"));
    //>>Chart 35
    String cht35Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][5]/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Baane Mini Imports", cht35Title1);
    String cht35Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][5]/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht35Subtitle1);
    //Check chart
    WebElement cht35SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][5]/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht35SizeBar);
    assertEquals("693.5422222222222", cht35SizeBar.getAttribute("width"));
    WebElement cht35RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][5]/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht35RectWhite1);
    assertEquals("translate(509.3333333333333,10) ", cht35RectWhite1.getAttribute("transform"));
    //>>Chart 36
    String cht36Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Mini Gifts Distributors Ltd.", cht36Title1);
    String cht36Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht36Subtitle1);
    //Check chart
    WebElement cht36SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht36SizeBar);
    assertEquals("764", cht36SizeBar.getAttribute("width"));
    WebElement cht36RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht36RectWhite1);
    assertEquals("translate(217.76722090261282,10) ", cht36RectWhite1.getAttribute("transform"));
    //>>Chart 37
    String cht37Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Havel & Zbyszek Co", cht37Title1);
    String cht37Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht37Subtitle1);
    //Check chart
    WebElement cht37SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='g'][2]/*[local-name()='rect']"),
            1);
    assertNull(cht37SizeBar);
    WebElement cht37RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht37RectWhite1);
    assertEquals("translate(509.3333333333333,10) ", cht37RectWhite1.getAttribute("transform"));
    //>>Chart 38
    String cht38Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][8]/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Blauer See Auto, Co.", cht38Title1);
    String cht38Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][8]/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Customer", cht38Subtitle1);
    //Check chart
    WebElement cht38SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][8]/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht38SizeBar);
    assertEquals("506.7866666666667", cht38SizeBar.getAttribute("width"));
    WebElement cht38RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj3']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][8]/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht38RectWhite1);
    assertEquals("translate(509.3333333333333,10) ", cht38RectWhite1.getAttribute("transform"));

    /*
     * ## Step 4
     */
    Actions acts = new Actions(driver);
    acts.moveToElement(this.elemHelper.FindElement(driver, By.cssSelector("div.webdetailsFooterWebdetails")));
    acts.perform();
    //Chart 4
    //Check title
    String subtitle4 = this.elemHelper.WaitForElementPresentGetText(driver, By.id("subtitle4"));
    assertEquals("Title, value and marker", subtitle4);
    //Check serie title and subtitle
    String cht4Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj4']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Atelier graphique", cht4Title1);
    String cht4Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj4']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Subtitle", cht4Subtitle1);
    //Check chart
    WebElement cht4SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj4']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht4SizeBar);
    WebElement cht4RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj4']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht4RectWhite1);

    /*
     * ## Step 5
     */
    //Chart 5
    //Check title
    String subtitle5 = this.elemHelper.WaitForElementPresentGetText(driver, By.id("subtitle5"));
    assertEquals("Complete dataset", subtitle5);
    //Check serie title and subtitle
    String cht5Title1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj5']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][6]/*[local-name()='text']"));
    assertEquals("Atelier graphique", cht5Title1);
    String cht5Subtitle1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='obj5']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][7]/*[local-name()='text']"));
    assertEquals("Carine Schmitt", cht5Subtitle1);
    //Check chart
    WebElement cht5SizeBar = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj5']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='rect']"));
    assertNotNull(cht5SizeBar);
    WebElement cht5RectWhite1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='obj5']/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='path'][1]"));
    assertNotNull(cht5RectWhite1);
}

From source file:com.pentaho.ctools.cde.reference.CCCV2ShowCase.java

License:Apache License

/**
 * ############################### Test Case 1 ###############################
 *
 * Test Case Name://from  ww w.  java 2 s  .c  o m
 *    BarChart
 * Description:
 *    The test case pretends validate the bar chart information.
 * Steps:
 *    1. Check Bar Chart
 */
@Test
public void tc01_ChartContent_DisplayedCorrect() {
    this.log.info("tc1_ChartContent_DisplayedCorrect");

    /*
     * ## Step 1 - Bar Chart
     */
    String barChartTitle = this.elemHelper.WaitForElementPresentGetText(driver, By.id("BarChartTitleRow"));
    assertEquals("Bar Chart", barChartTitle);
    // Check bars
    this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='BarChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='rect'][2]"));
    WebElement barChartRect1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='BarChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='rect'][1]"));
    WebElement barChartRect2 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='BarChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='rect'][2]"));
    WebElement barChartRect3 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='BarChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='rect'][3]"));
    assertNotNull(barChartRect1);
    assertNotNull(barChartRect2);
    assertNotNull(barChartRect3);
    Double barChartRect1Width = Double.parseDouble(barChartRect1.getAttribute("width"));
    Double barChartRect2Width = Double.parseDouble(barChartRect2.getAttribute("width"));
    Double barChartRect3Width = Double.parseDouble(barChartRect3.getAttribute("width"));
    assertThat("Current width: " + barChartRect1Width, barChartRect1Width, greaterThan(Double.valueOf(192)));
    assertThat("Current width: " + barChartRect2Width, barChartRect2Width, greaterThan(Double.valueOf(250)));
    assertThat("Current width: " + barChartRect3Width, barChartRect3Width, greaterThan(Double.valueOf(100)));
    // Check bars value
    String barChartRectValue1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='BarChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='text'][1]"));
    String barChartRectValue2 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='BarChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='text'][2]"));
    String barChartRectValue3 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='BarChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='text'][3]"));
    assertEquals("3.68M", barChartRectValue1);
    assertEquals("4.99M", barChartRectValue2);
    assertEquals("1.98M", barChartRectValue3);

    // Mouse hover elements
    Actions acts = new Actions(driver);
    acts.moveToElement(barChartRect2);
    acts.perform();
    String seriesLabel = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[1]/td[1]/span"));
    acts.perform();
    String seriesValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[1]/td[3]/span"));
    acts.perform();
    String timeLabel = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[2]/td[1]/span"));
    acts.perform();
    String timeValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[2]/td[3]/span"));
    acts.perform();
    String valueLabel = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[3]/td[1]/span"));
    acts.perform();
    String valueValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[3]/td[3]/span"));
    assertEquals("Series", seriesLabel);
    assertEquals("Sales", seriesValue);
    assertEquals("Time", timeLabel);
    assertEquals("2004", timeValue);
    assertEquals("Value", valueLabel);
    assertEquals("4,987,739.84", valueValue);

    //To move the focus to another element, in order to remove the tooltip
    Actions acts2 = new Actions(driver);
    acts2.moveToElement(this.elemHelper.FindElement(driver, By.id("BarChartTitleRow")));
    acts2.click();
    acts2.perform();
}

From source file:com.pentaho.ctools.cde.reference.CCCV2ShowCase.java

License:Apache License

/**
 * ############################### Test Case 2 ###############################
 *
 * Test Case Name:/*from  www . j  ava 2s  . c o m*/
 *    LineChart
 * Description:
 *    The test case pretends validate the line chart information.
 * Steps:
 *    1. Check Line Chart
 */
@Test
public void tc02_ChartContent_DisplayedCorrect() {
    this.log.info("tc02_ChartContent_DisplayedCorrect");

    /*
     * ## Step 2 - Line Chart
     */
    String lineChartTitle = this.elemHelper.WaitForElementPresentGetText(driver, By.id("LineChartTitleRow"));
    assertEquals("Line Chart", lineChartTitle);
    // Check lines
    WebElement lineChartCircle1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='LineChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='circle'][1]"));
    WebElement lineChartCircle2 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='LineChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='circle'][7]"));
    WebElement lineChartCircle3 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='LineChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='circle'][11]"));
    Double lineChartCircle1Cy = Double.parseDouble(lineChartCircle1.getAttribute("cy"));
    Double lineChartCircle2Cy = Double.parseDouble(lineChartCircle2.getAttribute("cy"));
    Double lineChartCircle3Cy = Double.parseDouble(lineChartCircle3.getAttribute("cy"));
    assertThat("Current cy: " + lineChartCircle1Cy, lineChartCircle1Cy, greaterThan(Double.valueOf(120)));
    assertThat("Current cy: " + lineChartCircle2Cy, lineChartCircle2Cy, greaterThan(Double.valueOf(136)));
    assertThat("Current cy: " + lineChartCircle3Cy, lineChartCircle3Cy, greaterThan(Double.valueOf(24)));

    // Mouse hover elements
    WebElement lineChartCircle4 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='LineChartBodyRow']/div/div/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='circle'][2]"));
    Actions acts = new Actions(driver);
    acts.moveToElement(lineChartCircle4);
    acts.perform();
    String measuresLabel = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[1]/td[1]/span"));
    acts.perform();
    String measuresValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[1]/td[3]/span"));
    acts.perform();
    String categoryLabel = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[2]/td[1]/span"));
    acts.perform();
    String categoryValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[2]/td[3]/span"));
    acts.perform();
    String valueLineValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-s']/div[2]/div/table/tbody/tr[4]/td[3]/span"));
    assertEquals("Measures", measuresLabel);
    assertEquals("Quantity", measuresValue);
    assertEquals("Category", categoryLabel);
    assertEquals("Feb", categoryValue);
    assertEquals("7,959", valueLineValue);

    //To move the focus to another element, in order to remove the tooltip
    Actions acts2 = new Actions(driver);
    acts2.moveToElement(this.elemHelper.FindElement(driver, By.id("LineChartTitleRow")));
    acts2.click();
    acts2.perform();
}

From source file:com.pentaho.ctools.cde.reference.MapComponentFullTest.java

License:Apache License

/**
 * ############################### Test Case 2 ###############################
 *
 * Test Case Name:/* w w  w . j  a  va2  s  .co m*/
 *    Full Map with CGG Markers and PopupWindows
 * Description:
 *    In this test case we pretend to check if the markers and popups windows
 *    are displayed.
 * Steps:
 *    1. Check the data exist
 *    2. Chick in each marker
 *    3. Check tooltip
 *    4. Check disabling series in pie chart
 */
@Test
public void tc2_MapCGGMarkersAndPopupWindows_MarkersAndPopupsDisplayed() {
    this.log.info("tc2_MapCGGMarkersAndPopupWindows_MarkersAndPopupsDisplayed");

    /*
     * ## Step 1
     */
    WebElement marker1 = this.elemHelper.FindElement(driver, By.xpath("//*[local-name()='image'][1]"));
    WebElement marker2 = this.elemHelper.FindElement(driver, By.xpath("//*[local-name()='image'][2]"));
    WebElement marker3 = this.elemHelper.FindElement(driver, By.xpath("//*[local-name()='image'][3]"));
    WebElement marker4 = this.elemHelper.FindElement(driver, By.xpath("//*[local-name()='image'][4]"));
    WebElement marker5 = this.elemHelper.FindElement(driver, By.xpath("//*[local-name()='image'][5]"));
    WebElement marker6 = this.elemHelper.FindElement(driver, By.xpath("//*[local-name()='image'][6]"));
    WebElement marker7 = this.elemHelper.FindElement(driver, By.xpath("//*[local-name()='image'][7]"));
    assertNotNull(marker1);
    assertNotNull(marker2);
    assertNotNull(marker3);
    assertNotNull(marker4);
    assertNotNull(marker5);
    assertNotNull(marker6);
    assertNotNull(marker7);

    /*
     *
     * THE BELOW CODE HAVE TO BE MODIFIED TO PASS ON AUTOMATION MACHINE
     * THAT NIGHTLY RUNS THE TESTS.
     *
     */

    /*
     * ## Step 2
     */
    // Zoom in - in order for the elements to be visible
    this.elemHelper.FindElement(driver, By.xpath("//div[@id='testWithGeoLocalization']/div/div[5]/div[3]"))
            .click();
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    Actions acts2 = new Actions(driver);
    acts2.moveToElement(driver.findElement(By.id("dfooter"))).perform();
    // >>> Open Marker 1
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image']"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Check we have the expect series displayed
    String marker1Serie1 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker1Serie2 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][2]//*[local-name()='text']"));
    String marker1Serie3 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][3]//*[local-name()='text']"));
    String marker1Serie4 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker1Serie5 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][2]//*[local-name()='text']"));
    assertEquals("Vintage Cars", marker1Serie1);
    assertEquals("Trucks and Buses", marker1Serie2);
    assertEquals("Ships", marker1Serie3);
    assertEquals("Motorcycles", marker1Serie4);
    assertEquals("Trains", marker1Serie5);
    String popupTitle = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//*[local-name()='svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='text']"));
    assertEquals("Sales For Product", popupTitle);
    // Check the pie chart is present
    WebElement marker1SeriesTrains = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][5]"));
    assertEquals("rgb(148,103,189)", marker1SeriesTrains.getAttribute("fill"));
    // Close popup
    this.elemHelper.FindElement(driver, By.id("featurePopup_close")).click();

    // >>> Open Marker 2
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image'][2]"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Check we have the expect series displayed
    String marker2Serie1 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker2Serie2 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][2]//*[local-name()='text']"));
    String marker2Serie3 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][3]//*[local-name()='text']"));
    assertEquals("Trucks and Buses", marker2Serie1);
    assertEquals("Ships", marker2Serie2);
    assertEquals("Motorcycles", marker2Serie3);
    String marker2PopupTitle = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//*[local-name()='svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='text']"));
    assertEquals("Sales For Product", marker2PopupTitle);
    // Check the pie chart is present
    WebElement marker2SeriesShips = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][3]"));
    assertEquals("rgb(44,160,44)", marker2SeriesShips.getAttribute("fill"));
    // Close popup
    this.elemHelper.FindElement(driver, By.id("featurePopup_close")).click();

    // >>> Open Marker 3
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image'][3]"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Check we have the expect series displayed
    String marker3Serie1 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker3Serie2 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][2]//*[local-name()='text']"));
    assertEquals("Motorcycles", marker3Serie1);
    assertEquals("Trains", marker3Serie2);
    String marker3PopupTitle = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//*[local-name()='svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='text']"));
    assertEquals("Sales For Product", marker3PopupTitle);
    // Check the pie chart is present
    WebElement marker3SeriesMotorcycles = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][2]"));
    assertEquals("rgb(255,127,14)", marker3SeriesMotorcycles.getAttribute("fill"));
    // Close popup
    this.elemHelper.FindElement(driver, By.id("featurePopup_close")).click();

    // >>> Open Marker 4
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image'][4]"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Check we have the expect series displayed
    String marker4Serie1 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker4Serie2 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][2]//*[local-name()='text']"));
    String marker4Serie3 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][3]//*[local-name()='text']"));
    String marker4Serie4 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker4Serie5 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][2]//*[local-name()='text']"));
    String marker4Serie6 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][3]//*[local-name()='text']"));
    assertEquals("Classic Cars", marker4Serie1);
    assertEquals("Vintage Cars", marker4Serie2);
    assertEquals("Trucks and Buses", marker4Serie3);
    assertEquals("Ships", marker4Serie4);
    assertEquals("Motorcycles", marker4Serie5);
    assertEquals("Trains", marker4Serie6);
    String marker4PopupTitle = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//*[local-name()='svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='text']"));
    assertEquals("Sales For Product", marker4PopupTitle);
    // Check the pie chart is present
    WebElement marker4SeriesTrains = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][2]"));
    assertEquals("rgb(255,127,14)", marker4SeriesTrains.getAttribute("fill"));
    // Close popup
    this.elemHelper.FindElement(driver, By.id("featurePopup_close")).click();

    // >>> Open Marker 5
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image'][5]"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Check we have the expect series displayed
    String marker5Serie1 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker5Serie2 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][2]//*[local-name()='text']"));
    String marker5Serie3 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][3]//*[local-name()='text']"));
    String marker5Serie4 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker5Serie5 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][2]//*[local-name()='text']"));
    String marker5Serie6 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][3]//*[local-name()='text']"));
    assertEquals("Classic Cars", marker5Serie1);
    assertEquals("Vintage Cars", marker5Serie2);
    assertEquals("Trucks and Buses", marker5Serie3);
    assertEquals("Ships", marker5Serie4);
    assertEquals("Motorcycles", marker5Serie5);
    assertEquals("Trains", marker5Serie6);
    String marker5PopupTitle = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//*[local-name()='svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='text']"));
    assertEquals("Sales For Product", marker5PopupTitle);
    // Check the pie chart is present
    WebElement marker5SeriesTrains = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][6]"));
    assertEquals("rgb(140,86,75)", marker5SeriesTrains.getAttribute("fill"));
    // Close popup
    this.elemHelper.FindElement(driver, By.id("featurePopup_close")).click();

    // >>> Open Marker 6
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image'][6]"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Check we have the expect series displayed
    String marker6Serie1 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker6Serie2 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][2]//*[local-name()='text']"));
    assertEquals("Trains", marker6Serie1);
    assertEquals("Motorcycles", marker6Serie2);
    String marker6PopupTitle = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//*[local-name()='svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='text']"));
    assertEquals("Sales For Product", marker6PopupTitle);
    // Check the pie chart is present
    WebElement marker6SeriesTrains = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][1]"));
    assertEquals("rgb(31,119,180)", marker6SeriesTrains.getAttribute("fill"));
    // Close popup
    this.elemHelper.FindElement(driver, By.id("featurePopup_close")).click();

    // >>> Open Marker 7
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image'][7]"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Check we have the expect series displayed
    String marker7Serie1 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"));
    String marker7Serie2 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][2]//*[local-name()='text']"));
    String marker7Serie3 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][3]//*[local-name()='text']"));
    String marker7Serie4 = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][1]//*[local-name()='text']"));
    assertEquals("Classic Cars", marker7Serie1);
    assertEquals("Vintage Cars", marker7Serie2);
    assertEquals("Trucks and Buses", marker7Serie3);
    assertEquals("Ships", marker7Serie4);
    String marker7PopupTitle = this.elemHelper.GetTextElementInvisible(driver, By.xpath(
            "//*[local-name()='svg']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='text']"));
    assertEquals("Sales For Product", marker7PopupTitle);
    // Check the pie chart is present
    WebElement marker7SeriesMotorcycles = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][2]"));
    assertEquals("rgb(255,127,14)", marker7SeriesMotorcycles.getAttribute("fill"));
    // Close popup
    this.elemHelper.FindElement(driver, By.id("featurePopup_close")).click();

    /*
     * ## Step 3
     */
    driver.findElement(By.xpath(
            "//div[@id='testWithGeoLocalization']/div/div/div[5]/*[local-name()='svg']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='image'][5]"))
            .click();
    // Wait for loading disappear
    this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay"));
    this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='HiddenContentCol']"));
    // Move mouse to element
    WebElement marker5SeriesClassicCars = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][1]"));
    Actions acts = new Actions(driver);
    acts.moveToElement(marker5SeriesClassicCars);
    acts.perform();
    String tooltipProduct = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-sww']/div[2]/div/table/tbody/tr[1]/td[1]/span"));
    acts.perform();
    String tooltipProductValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-sww']/div[2]/div/table/tbody/tr[1]/td[3]/span"));
    acts.perform();
    String tooltipSeries = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-sww']/div[2]/div/table/tbody/tr[2]/td[1]/span"));
    acts.perform();
    String tooltipSeriesValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-sww']/div[2]/div/table/tbody/tr[2]/td[3]/span"));
    acts.perform();
    String tooltipValues = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-sww']/div[2]/div/table/tbody/tr[3]/td[1]/span"));
    acts.perform();
    String tooltipValuesValue = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-sww']/div[2]/div/table/tbody/tr[3]/td[3]/span[1]"));
    acts.perform();
    String tooltipValuesValueP = this.elemHelper.WaitForElementPresentGetText(driver,
            By.xpath("//div[@class='tipsy tipsy-sww']/div[2]/div/table/tbody/tr[3]/td[3]/span[2]"));
    assertEquals("Product", tooltipProduct);
    assertEquals("Classic Cars", tooltipProductValue);
    assertEquals("Series", tooltipSeries);
    assertEquals("Quantity", tooltipSeriesValue);
    assertEquals("Value", tooltipValues);
    assertEquals("2,381", tooltipValuesValue);
    assertEquals("37.4%", tooltipValuesValueP);

    /*
     * ## Step 4
     */
    // Disable 'Classic Cars'
    this.elemHelper.FindElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][1]//*[local-name()='text']"))
            .click();
    this.elemHelper.WaitForElementInvisibility(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][6]"));
    // Disable 'Trucks and Buses'
    this.elemHelper.FindElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][1]/*[local-name()='g'][3]//*[local-name()='text']"))
            .click();
    this.elemHelper.WaitForElementInvisibility(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][5]"));
    // Disable 'Ships'
    this.elemHelper.FindElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][1]//*[local-name()='text']"))
            .click();
    this.elemHelper.WaitForElementInvisibility(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][4]"));
    // Disable 'Motorcycles'
    this.elemHelper.FindElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][2]//*[local-name()='text']"))
            .click();
    this.elemHelper.WaitForElementInvisibility(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][3]"));
    // Disable 'Trains'
    this.elemHelper.FindElementInvisible(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='g']/*[local-name()='g']/*[local-name()='g'][2]/*[local-name()='g'][3]//*[local-name()='text']"))
            .click();
    this.elemHelper.WaitForElementInvisibility(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g']/*[local-name()='path'][2]"));
    // Check the values for the pie char for serie Vintage Cars
    String marker5SerieVintageCarsValue = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g'][2]/*[local-name()='g'][2]/*[local-name()='text'][1]"));
    String marker5SerieVintageCarsValuePer = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath(
            "//div[@id='HiddenContentCol']/div/*[local-name()='svg']/*[local-name()='g']/*[local-name()='g'][3]/*[local-name()='g'][2]/*[local-name()='g'][2]/*[local-name()='text'][2]"));
    assertEquals("1,753", marker5SerieVintageCarsValue);
    assertEquals("(100%)", marker5SerieVintageCarsValuePer);
}

From source file:com.pentaho.ctools.cde.reference.MapComponentReference.java

License:Apache License

/**
 * ############################### Test Case 6 ###############################
 *
 * Test Case Name:/* w  w  w .  j  a v  a2s . c o m*/
 *    Map with Shapes
 * Description:
 *    Check if the map has shapes and by click in a known shape must change
 *    its color.
 * Steps:
 *    1. Check the data exist
 *    2. Chick in a shape country
 */
@Test
public void tc6_MapWithShapes_ShapesAreClickable() {
    this.log.info("tc6_MapWithShapes_ShapesAreClickable");

    //Zoom in the map
    this.elemHelper.FindElement(driver, By.xpath("//div[12]/div/div/div[5]/div[3]")).click();

    /*
     * ## Step 1
     */
    final WebElement shape1 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][2]"));
    final WebElement shape2 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][10]"));
    final WebElement shape3 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][13]"));
    final WebElement shape4 = this.elemHelper.FindElement(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][14]"));
    assertNotNull(shape1);
    assertNotNull(shape2);
    assertNotNull(shape3);
    assertNotNull(shape4);
    this.elemHelper.WaitForAttributeValue(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][2]"),
            "fill", "rgba(255,8,0,255)", 10);
    this.elemHelper.WaitForAttributeValue(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][10]"),
            "fill", "rgba(183,212,0,255)", 15);
    this.elemHelper.WaitForAttributeValue(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][13]"),
            "fill", "rgba(167,202,0,255)", 15);
    this.elemHelper.WaitForAttributeValue(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][14]"),
            "fill", "rgba(167,202,0,255)", 15);
    final String attrFillShape1 = this.elemHelper.GetAttribute(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][2]"),
            "fill");
    final String attrFillShape2 = this.elemHelper.GetAttribute(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][10]"),
            "fill");
    final String attrFillShape3 = this.elemHelper.GetAttribute(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][13]"),
            "fill");
    final String attrFillShape4 = this.elemHelper.GetAttribute(driver, By.xpath(
            "//div[@id='testWithShapes']/div/div/div[5]/*[local-name()='svg' and namespace-uri()='http://www.w3.org/2000/svg']/*[local-name()='g'][2]/*[local-name()='g']/*[local-name()='path'][14]"),
            "fill");
    assertEquals("rgba(255,8,0,255)", attrFillShape1);
    assertEquals("rgba(183,212,0,255)", attrFillShape2);
    assertEquals("rgba(167,202,0,255)", attrFillShape3);
    assertEquals("rgba(167,202,0,255)", attrFillShape4);

    /*
     * ## Step 2
     */
    //Click in shape4 (England) and check it comes with red.
    String shapeId = shape1.getAttribute("id");
    shape1.click();
    //Wait for change color
    this.elemHelper.WaitForElementPresenceAndVisible(driver,
            By.xpath("//*[local-name()='path' and @fill='red']"));
    WebElement shapeRed = this.elemHelper.FindElement(driver, By.id(shapeId));
    assertEquals("red", shapeRed.getAttribute("fill"));

    //Related to issue CDE-317
    final Actions action = new Actions(driver);
    action.moveToElement(shape2).build().perform();
    action.moveToElement(shape1).build().perform();
    shapeId = shape1.getAttribute("id");
    shapeRed = this.elemHelper.FindElement(driver, By.id(shapeId));
    assertEquals("red", shapeRed.getAttribute("fill"));
}