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();
}
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);
}
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);
}
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());
}
}
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();
}
}
Aggregations