use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class MobileNativeClickSnippet method execute.
@Override
public void execute() throws Exception {
findElement();
WebElement targetElement = getElement();
try {
if (!targetElement.isEnabled()) {
throw new AutomatorException(ELEMENT_IS_DISABLED);
}
targetElement.click();
} catch (StaleElementReferenceException staleException) {
log.info("Encountered StaleElementReferenceException");
handleStaleelementExecptionOnClickAction();
}
setSuccessMessage(SUCCESS_MESSAGE);
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class IfElementProxyAction method execute.
@Override
public void execute() throws Exception {
String status = getTestData();
switch(status) {
case ActionConstants.ENABLED:
VerifyElementEnabledAction enabled = (VerifyElementEnabledAction) this.initializeChildSnippet(VerifyElementEnabledAction.class);
enabled.execute();
this.setSuccessMessage(enabled.getSuccessMessage());
break;
case ActionConstants.DISABLED:
VerifyElementDisabledAction disabled = (VerifyElementDisabledAction) this.initializeChildSnippet(VerifyElementDisabledAction.class);
disabled.execute();
this.setSuccessMessage(disabled.getSuccessMessage());
break;
case ActionConstants.VISIBLE:
VerifyElementPresenceAction visible = (VerifyElementPresenceAction) this.initializeChildSnippet(VerifyElementPresenceAction.class);
visible.execute();
this.setSuccessMessage(visible.getSuccessMessage());
break;
case ActionConstants.NOT_VISIBLE:
VerifyElementAbsenceAction notVisible = (VerifyElementAbsenceAction) this.initializeChildSnippet(VerifyElementAbsenceAction.class);
notVisible.execute();
this.setSuccessMessage(notVisible.getSuccessMessage());
break;
default:
setErrorMessage("Unable to Perform Verify Action due to error at test data");
throw new AutomatorException("Unable to Perform Verify Action due to error at test data");
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class AlertVisibilityStatusAction method execute.
@Override
public void execute() throws Exception {
String status = getTestData();
switch(status) {
case ActionConstants.NOT_VISIBLE:
VerifyAlertAbsenceAction absence = (VerifyAlertAbsenceAction) this.initializeChildSnippet(VerifyAlertAbsenceAction.class);
absence.execute();
this.setSuccessMessage(absence.getSuccessMessage());
break;
case ActionConstants.VISIBLE:
VerifyAlertPresenceAction available = (VerifyAlertPresenceAction) this.initializeChildSnippet(VerifyAlertPresenceAction.class);
available.execute();
this.setSuccessMessage(available.getSuccessMessage());
break;
default:
setErrorMessage("Unable to Perform Alert Visibility Action due to error at test data");
throw new AutomatorException("Unable to Perform Alert Visibility Action due to error at test data");
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class WaitUntilAllImagesAreLoadedAction method execute.
@Override
protected void execute() throws Exception {
try {
constructElementWithDynamicXpath("//XCUIElementTypeImage", TESTS_TEP_DATA_MAP_KEY_ELEMENT, null, null, false);
// ExpectedConditions.visibilityOfElements always fails ..bcz in IOS element.isDisplayed() for images is always returning false.
List<WebElement> elements = getWebDriverWait().until(CustomExpectedConditions.allElementsAreEnabled(getBy()));
Assert.notNull(elements, FAILURE_MESSAGE);
setSuccessMessage(SUCCESS_MESSAGE);
} catch (TimeoutException e) {
throw new AutomatorException(FAILURE_MESSAGE, (Exception) e.getCause());
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class MobileNativeWaitUntilAlertIsVisibleAction method execute.
@Override
public void execute() throws Exception {
try {
getWebDriverWait().until(ExpectedConditions.visibilityOfElementLocated(getBy()));
verifyAlertPresence(FAILURE_NO_ALERT);
} catch (TimeoutException e) {
throw new AutomatorException(String.format(FAILURE_MESSAGE, getTimeout()), (Exception) e.getCause());
}
setSuccessMessage(SUCCESS_MESSAGE);
}
Aggregations