use of com.testsigma.automator.actions.FindByType in project testsigma by testsigmahq.
the class DragAndDropAction method getElement.
private WebElement getElement(String elementActionVarName, LocatorType locatorType, String locatorValue) throws Exception {
FindByType findByType = FindByType.getType(locatorType);
ElementPropertiesEntity elementPropertiesEntity = new ElementPropertiesEntity();
elementPropertiesEntity.setFindByType(findByType);
elementPropertiesEntity.setLocatorValue(locatorValue);
elementPropertiesEntity.setElementName("ui-iden");
elementPropertiesEntity.setDynamicLocator(true);
Map<String, ElementPropertiesEntity> elementPropertiesMap = getElementPropertiesEntityMap();
if (elementPropertiesMap == null) {
elementPropertiesMap = new HashMap<>();
setElementPropertiesEntityMap(elementPropertiesMap);
}
getElementPropertiesEntityMap().put(elementActionVarName, elementPropertiesEntity);
findElement(elementActionVarName);
return getElement();
}
use of com.testsigma.automator.actions.FindByType in project testsigma by testsigmahq.
the class DriverSessionActionsController method searchByIndexAndSendKeys.
@PostMapping(value = "/search_and_send_keys")
@ResponseStatus(HttpStatus.ACCEPTED)
public void searchByIndexAndSendKeys(@PathVariable("session_id") String sessionId, @RequestParam("platform") Platform platform, @RequestParam("locatorType") LocatorType locatorType, @RequestParam("byValue") String byValue, @RequestParam("index") Integer index, @RequestParam("keys") String keys, @Nullable @RequestParam(value = "webViewName", required = false) String webViewName) throws Exception {
FindByType findByType = FindByType.getType(locatorType);
ElementSearchCriteria elementSearchCriteria = new ElementSearchCriteria(findByType, byValue);
log.info("Request for searching the Element By Index and Tapping on it, in session - " + sessionId + ",for locatorType - " + locatorType + ", byValue - " + byValue + ", index - " + index + ", keys -" + keys);
driverSessionCommand.findElementByIndexAndSendKey(sessionId, platform, elementSearchCriteria, index, keys, webViewName);
}
use of com.testsigma.automator.actions.FindByType in project testsigma by testsigmahq.
the class DriverSessionActionsController method searchByIndexAndTapElement.
@PostMapping(value = "/search_and_tap")
@ResponseStatus(HttpStatus.ACCEPTED)
public void searchByIndexAndTapElement(@PathVariable("session_id") String sessionId, @RequestParam("platform") Platform platform, @RequestParam("locatorType") LocatorType locatorType, @RequestParam("byValue") String byValue, @RequestParam("index") Integer index, @Nullable @RequestParam(value = "webViewName", required = false) String webViewName) throws Exception {
FindByType findByType = FindByType.getType(locatorType);
ElementSearchCriteria elementSearchCriteria = new ElementSearchCriteria(findByType, byValue);
log.info("Request for searching the Element By Index and Tapping on it, in session - " + sessionId + ",for locatorType - " + locatorType + ", byValue - " + byValue + ", index - " + index);
driverSessionCommand.findElementByIndexAndTap(sessionId, platform, elementSearchCriteria, index, webViewName);
}
use of com.testsigma.automator.actions.FindByType in project testsigma by testsigmahq.
the class ListFrameAction method getElements.
private List<WebElement> getElements(String elementActionVarName, LocatorType locatorType, String locatorValue) throws Exception {
FindByType findByType = FindByType.getType(locatorType);
ElementPropertiesEntity elementPropertiesEntity = new ElementPropertiesEntity();
elementPropertiesEntity.setFindByType(findByType);
elementPropertiesEntity.setLocatorValue(locatorValue);
elementPropertiesEntity.setElementName("ui-iden");
elementPropertiesEntity.setDynamicLocator(true);
Map<String, ElementPropertiesEntity> elementPropertiesMap = getElementPropertiesEntityMap();
if (elementPropertiesMap == null) {
elementPropertiesMap = new HashMap<>();
setElementPropertiesEntityMap(elementPropertiesMap);
}
getElementPropertiesEntityMap().put(elementActionVarName, elementPropertiesEntity);
findElement(elementActionVarName);
return getElements();
}
use of com.testsigma.automator.actions.FindByType in project testsigma by testsigmahq.
the class DriverSessionActionsController method searchByIndexAndClearElement.
@PostMapping(value = "/search_and_clear")
@ResponseStatus(HttpStatus.ACCEPTED)
public void searchByIndexAndClearElement(@PathVariable("session_id") String sessionId, @RequestParam("platform") Platform platform, @RequestParam("locatorType") LocatorType locatorType, @RequestParam("byValue") String byValue, @RequestParam("index") Integer index, @Nullable @RequestParam(value = "webViewName", required = false) String webViewName) throws Exception {
FindByType findByType = FindByType.getType(locatorType);
ElementSearchCriteria elementSearchCriteria = new ElementSearchCriteria(findByType, byValue);
log.info("Request for searching the Element By Index and Clearing it, in session - " + sessionId + ",for locatorType - " + locatorType + ", byValue - " + byValue + ", index - " + index);
driverSessionCommand.findElementByIndexAndClear(sessionId, platform, elementSearchCriteria, index, webViewName);
}
Aggregations