use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class IosDeviceService method setupWda.
public void setupWda(MobileDevice device) throws TestsigmaException, AutomatorException {
log.info("Setting up WDA on device - " + device.getName());
try {
wdaService.installWdaToDevice(device);
wdaService.startWdaOnDevice(device);
} catch (Exception e) {
log.error("Error while setting up wda and starting it. Error - ");
log.error(e.getMessage(), e);
cleanupWda(device);
throw new TestsigmaException(e.getMessage(), e);
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class CheckboxElementStatusAction method execute.
@Override
public void execute() throws Exception {
String status = getTestData();
switch(status) {
case ActionConstants.CHECKED:
MobileNativeVerifyCheckedAction checked = (MobileNativeVerifyCheckedAction) this.initializeChildSnippet(MobileNativeVerifyCheckedAction.class);
checked.execute();
this.setSuccessMessage(checked.getSuccessMessage());
break;
case ActionConstants.UN_CHECKED:
MobileNativeVerifyUnCheckedAction unChecked = (MobileNativeVerifyUnCheckedAction) this.initializeChildSnippet(MobileNativeVerifyUnCheckedAction.class);
unChecked.execute();
this.setSuccessMessage(unChecked.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 IfElementProxyAction method execute.
@Override
public void execute() throws Exception {
String status = getTestData();
switch(status) {
case ActionConstants.ENABLED:
VerifyEnabledSnippet enabled = (VerifyEnabledSnippet) this.initializeChildSnippet(VerifyEnabledSnippet.class);
enabled.execute();
this.setSuccessMessage(enabled.getSuccessMessage());
break;
case ActionConstants.DISABLED:
VerifyDisabledSnippet disabled = (VerifyDisabledSnippet) this.initializeChildSnippet(VerifyDisabledSnippet.class);
disabled.execute();
this.setSuccessMessage(disabled.getSuccessMessage());
break;
case ActionConstants.VISIBLE:
VerifyElementPresentSnippet visible = (VerifyElementPresentSnippet) this.initializeChildSnippet(VerifyElementPresentSnippet.class);
visible.execute();
this.setSuccessMessage(visible.getSuccessMessage());
break;
case ActionConstants.NOT_VISIBLE:
VerifyElementAbsentSnippet notVisible = (VerifyElementAbsentSnippet) this.initializeChildSnippet(VerifyElementAbsentSnippet.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 PressMobileNativeKeyProxyAction method execute.
@Override
public void execute() throws Exception {
String key = getTestData();
switch(key) {
case ActionConstants.SPACE:
MobileNativePressSpaceAction space = (MobileNativePressSpaceAction) this.initializeChildSnippet(MobileNativePressSpaceAction.class);
space.execute();
this.setSuccessMessage(space.getSuccessMessage());
break;
case ActionConstants.ENTER:
MobileNativePressEnterAction enter = (MobileNativePressEnterAction) this.initializeChildSnippet(MobileNativePressEnterAction.class);
enter.execute();
this.setSuccessMessage(enter.getSuccessMessage());
break;
case ActionConstants.BACKSPACE:
MobileNativePressBackSpaceAction backSpace = (MobileNativePressBackSpaceAction) this.initializeChildSnippet(MobileNativePressBackSpaceAction.class);
backSpace.execute();
this.setSuccessMessage(backSpace.getSuccessMessage());
break;
case ActionConstants.SEARCH:
TapOnSearchInKeyboardAction available = (TapOnSearchInKeyboardAction) this.initializeChildSnippet(TapOnSearchInKeyboardAction.class);
available.execute();
this.setSuccessMessage(available.getSuccessMessage());
break;
default:
setErrorMessage("Unable to Perform Press Key Action due to error at test data");
throw new AutomatorException("Unable to Perform Press Key Action due to error at test data");
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class MobileInspectorTapOnElement method execute.
@Override
public void execute() throws Exception {
AppiumDriver driver = getDriver();
findElement();
WebElement targetElement = getElement();
try {
if (!targetElement.isEnabled()) {
throw new AutomatorException(ELEMENT_IS_DISABLED);
} else if (!targetElement.isDisplayed()) {
throw new AutomatorException(ELEMENT_IS_NOT_DISPLAYED);
}
if (driver.getContextHandles().size() > 1) {
tapByElementCoOrdinates(getElement(), driver);
} else {
targetElement.click();
}
} catch (StaleElementReferenceException staleException) {
log.info("Encountered StaleElementReferenceException");
handleStaleelementExecptionOnClickAction();
}
setSuccessMessage(SUCCESS_MESSAGE);
}
Aggregations