Search in sources :

Example 11 with NoSuchElementException

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

the class VisualEditorAddMapDialog method addExistingMap.

public VisualEditorPageObject addExistingMap(int number) {
    waitForDialogVisible();
    WebElement mediaResultsWidget = mediaDialogBody.findElement(mediaResultsWidgetBy);
    if (isElementOnPage(mediaResultsWidget)) {
        wait.forElementVisible(mediaResultsWidget);
        List<WebElement> maps = mediaResultsWidget.findElements(mediaResultsBy);
        WebElement map = maps.get(number);
        map.click();
    } else {
        throw new NoSuchElementException("The dialog is in empty state, the wiki needs to contain map.");
    }
    waitForDialogNotVisible();
    return new VisualEditorPageObject();
}
Also used : VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) WebElement(org.openqa.selenium.WebElement) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 12 with NoSuchElementException

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

the class VisualEditorEditTemplateDialog method typeInParam.

public void typeInParam(String paramName, String text) {
    waitForDialogVisible();
    if (isElementOnPage(TEMPLATE_PARAMS_BY)) {
        WebElement targetParam = Elements.getElementByChildText(templateParams, PARAM_LABEL_BY, paramName);
        WebElement targetParamInput = targetParam.findElement(PARAM_INPUT_BY);
        targetParamInput.sendKeys(text);
        waitForValueToBePresentInElementsAttributeByElement(targetParamInput, "value", text);
    } else {
        throw new NoSuchElementException("This template has no param.");
    }
    PageObjectLogging.log("typeInParam", "Type " + text + " in the " + paramName + " field.", true, driver);
}
Also used : WebElement(org.openqa.selenium.WebElement) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 13 with NoSuchElementException

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

the class TableBuilderComponentObject method selectHeader.

public void selectHeader(Headers header) {
    wait.forElementVisible(tablePropertiesDropdownOptions.get(0));
    Select headerDropdown = new Select(tablePropertiesDropdownOptions.get(0));
    switch(header) {
        case NONE:
            headerDropdown.selectByIndex(header.ordinal());
            break;
        case FIRSTROW:
            headerDropdown.selectByIndex(header.ordinal());
            break;
        case FIRSTCOLUMN:
            headerDropdown.selectByIndex(header.ordinal());
            break;
        case BOTH:
            headerDropdown.selectByIndex(header.ordinal());
            break;
        default:
            throw new NoSuchElementException("Non-existing header selected");
    }
    PageObjectLogging.log("selectHeader", header.toString() + " header selected", true, driver);
}
Also used : Select(org.openqa.selenium.support.ui.Select) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 14 with NoSuchElementException

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

the class ArticlePageObject method verifyURLVEActionEditEditor.

public void verifyURLVEActionEditEditor(Editor expectedEditor, String wikiURL) {
    switch(expectedEditor) {
        case VE:
            VisualEditorPageObject ve = openNewArticleEditModeVisual(wikiURL);
            ve.verifyVEToolBarPresent();
            ve.verifyEditorSurfacePresent();
            break;
        default:
            throw new NoSuchElementException("Invalid expected editor chosen: " + expectedEditor.name());
    }
}
Also used : VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 15 with NoSuchElementException

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

the class AdsBaseObject method verifyForcedSuccessScriptInSlots.

public void verifyForcedSuccessScriptInSlots(List<String> slots) {
    for (String slot : slots) {
        WebElement slotElement = driver.findElement(By.id(slot));
        WebElement slotGptIframe = slotElement.findElement(By.cssSelector("div > iframe"));
        driver.switchTo().frame(slotGptIframe);
        WebElement iframeHtml = driver.findElement(By.tagName("html"));
        String adDriverForcedSuccessFormatted = String.format(AdsContent.AD_DRIVER_FORCED_STATUS_SUCCESS_SCRIPT, slot);
        if (checkScriptPresentInElement(iframeHtml, adDriverForcedSuccessFormatted)) {
            PageObjectLogging.log("AdDriver2ForceStatus script", "adDriverForcedSuccess script found in slot " + slot, true);
        } else {
            throw new NoSuchElementException("AdDriver2ForcedStatus script not found in slot " + slot);
        }
        driver.switchTo().defaultContent();
    }
}
Also used : WebElement(org.openqa.selenium.WebElement) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Aggregations

NoSuchElementException (org.openqa.selenium.NoSuchElementException)32 WebElement (org.openqa.selenium.WebElement)18 AndroidElement (io.appium.java_client.android.AndroidElement)5 Select (org.openqa.selenium.support.ui.Select)5 ElementMenuOptions (com.owncloud.android.test.ui.models.ElementMenuOptions)4 WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)3 Test (org.junit.Test)3 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)3 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 SeleniumOperationException (com.axway.ats.uiengine.exceptions.SeleniumOperationException)2 RealHtmlElementState (com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState)2 FailingTestCategory (com.owncloud.android.test.ui.groups.FailingTestCategory)2 InProgressCategory (com.owncloud.android.test.ui.groups.InProgressCategory)2 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)2 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)2 UnfinishedTestCategory (com.owncloud.android.test.ui.groups.UnfinishedTestCategory)2 FileListView (com.owncloud.android.test.ui.models.FileListView)2 ShareView (com.owncloud.android.test.ui.models.ShareView)2 VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)2 Category (org.junit.experimental.categories.Category)2