Search in sources :

Example 91 with Actions

use of org.openqa.selenium.interactions.Actions in project geode by apache.

the class PulseBase method testTreeMapPopUpData.

public void testTreeMapPopUpData(String S1, String gridIcon) {
    for (int i = 1; i <= 3; i++) {
        searchByLinkAndClick(CLUSTER_VIEW_LABEL);
        if (gridIcon.equals(SERVER_GROUP_GRID_ID)) {
            WebElement ServerGroupRadio = getWebDriver().findElement(By.xpath("//label[@for='radio-servergroups']"));
            ServerGroupRadio.click();
        }
        if (gridIcon.equals(REDUNDANCY_GRID_ID)) {
            WebElement ServerGroupRadio = getWebDriver().findElement(By.xpath("//label[@for='radio-redundancyzones']"));
            ServerGroupRadio.click();
        }
        searchByIdAndClick(gridIcon);
        WebElement TreeMapMember = getWebDriver().findElement(By.xpath("//div[@id='" + S1 + "M" + (i) + "']/div"));
        Actions builder = new Actions(getWebDriver());
        builder.clickAndHold(TreeMapMember).perform();
        int j = 1;
        String CPUUsageM1temp = getWebDriver().findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div/div[2]/div")).getText();
        String CPUUsageM1 = CPUUsageM1temp.replaceAll("[\\%]", "");
        String cpuUsageM1 = JMXProperties.getInstance().getProperty("member.M" + (i) + ".cpuUsage");
        assertEquals(cpuUsageM1, CPUUsageM1);
        String MemoryUsageM1temp = getWebDriver().findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 1) + "]/div[2]/div")).getText();
        String MemoryUsageM1 = MemoryUsageM1temp.replaceAll("MB", "");
        String memoryUsageM1 = JMXProperties.getInstance().getProperty("member.M" + (i) + ".UsedMemory");
        assertEquals(memoryUsageM1, MemoryUsageM1);
        String LoadAvgM1 = getWebDriver().findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 2) + "]/div[2]/div")).getText();
        String loadAvgM1 = JMXProperties.getInstance().getProperty("member.M" + (i) + ".loadAverage");
        assertEquals(new DecimalFormat(PulseConstants.DECIMAL_FORMAT_PATTERN).format(Double.valueOf(loadAvgM1)), LoadAvgM1);
        String ThreadsM1 = getWebDriver().findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 3) + "]/div[2]/div")).getText();
        String threadsM1 = JMXProperties.getInstance().getProperty("member.M" + (i) + ".numThreads");
        assertEquals(threadsM1, ThreadsM1);
        String SocketsM1 = getWebDriver().findElement(By.xpath("//div[@id='_tooltip']/div/div/div[2]/div[" + (j + 4) + "]/div[2]/div")).getText();
        String socketsM1 = JMXProperties.getInstance().getProperty("member.M" + (i) + ".totalFileDescriptorOpen");
        assertEquals(socketsM1, SocketsM1);
        builder.moveToElement(TreeMapMember).release().perform();
    }
}
Also used : Actions(org.openqa.selenium.interactions.Actions) DecimalFormat(java.text.DecimalFormat) WebElement(org.openqa.selenium.WebElement)

Example 92 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VisualEditorMenu method clickStyleItemFromDropDown.

private void clickStyleItemFromDropDown(By styleBy) {
    WebElement styleListElement = toolListDropDowns.get(STYLE_LIST);
    WebElement styleItems = toolListItems.get(STYLE_LIST);
    wait.forElementVisible(styleListElement);
    Actions actions = new Actions(driver);
    actions.click(styleListElement).click(styleItems.findElement(styleBy)).build().perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 93 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VisualEditorMenu method clickFormatting.

public void clickFormatting(By formatBy) {
    wait.forElementClickable(formattingDropDown);
    Actions actions = new Actions(driver);
    actions.click(formattingDropDown).click(formattingDropDownItems.findElement(formatBy).findElement(menuItemBy)).build().perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 94 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class VisualEditorMenu method clickItemFromDropDown.

private void clickItemFromDropDown(WebElement list, WebElement item, WebElement insertBy) {
    wait.forElementClickable(list);
    Actions actions = new Actions(driver);
    actions.click(list).click(insertBy).build().perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 95 with Actions

use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.

the class ArticlePageObject method triggerEditCommentArea.

public MiniEditorComponentObject triggerEditCommentArea() {
    jsActions.scrollToElement(allCommentsArea);
    WebElement mostRecentComment = articleComments.get(0);
    PageObjectLogging.log("First check", mostRecentComment.getText(), true);
    JavascriptExecutor js = (JavascriptExecutor) driver;
    WebElement editButton = mostRecentComment.findElement(By.cssSelector(EDIT_BUTTON_SELECTOR));
    new Actions(driver).moveToElement(editButton).perform();
    js.executeScript("arguments[0].querySelector(arguments[1]).click()", mostRecentComment, EDIT_BUTTON_SELECTOR);
    return new MiniEditorComponentObject(driver);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) JavascriptExecutor(org.openqa.selenium.JavascriptExecutor) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Aggregations

Actions (org.openqa.selenium.interactions.Actions)116 WebElement (org.openqa.selenium.WebElement)72 WebDriver (org.openqa.selenium.WebDriver)26 Test (org.junit.Test)21 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)18 PublicAtsApi (com.axway.ats.common.PublicAtsApi)16 Action (org.openqa.selenium.interactions.Action)10 HiddenHtmlElementState (com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState)9 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)6 RealHtmlElementState (com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState)4 List (java.util.List)3 MobileOperationException (com.axway.ats.uiengine.exceptions.MobileOperationException)2 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)2 MobileElementState (com.axway.ats.uiengine.utilities.mobile.MobileElementState)2 AndroidDriver (io.appium.java_client.android.AndroidDriver)2 File (java.io.File)2 DecimalFormat (java.text.DecimalFormat)2 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)2 SystemException (com.github.bordertech.wcomponents.util.SystemException)1 VerticalLayoutElement (com.vaadin.testbench.elements.VerticalLayoutElement)1