use of com.testsigma.automator.actions.FindByType in project testsigma by testsigmahq.
the class DriverSessionActionsController method findElements.
@GetMapping(value = "/find_elements")
@ResponseStatus(HttpStatus.OK)
public List<MobileElementDTO> findElements(@PathVariable("session_id") String sessionId, @RequestParam("platform") Platform platform, @RequestParam("locatorType") LocatorType locatorType, @RequestParam("byValue") String byValue) throws MobileAutomationServerCommandExecutionException {
FindByType findByType = FindByType.getType(locatorType);
ElementSearchCriteria elementSearchCriteria = new ElementSearchCriteria(findByType, byValue);
log.info("Request for searching Elements in session - " + sessionId);
List<MobileElement> mobileElements = driverSessionCommand.findElements(sessionId, platform, elementSearchCriteria);
return mobileElementMapper.map(mobileElements);
}
use of com.testsigma.automator.actions.FindByType in project testsigma by testsigmahq.
the class GetAllCheckboxesAction 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();
}
Aggregations