Search in sources :

Example 6 with FindByType

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);
}
Also used : MobileElement(com.testsigma.automator.actions.mobile.MobileElement) FindByType(com.testsigma.automator.actions.FindByType) ElementSearchCriteria(com.testsigma.automator.actions.ElementSearchCriteria)

Example 7 with FindByType

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();
}
Also used : FindByType(com.testsigma.automator.actions.FindByType) ElementPropertiesEntity(com.testsigma.automator.entity.ElementPropertiesEntity)

Aggregations

FindByType (com.testsigma.automator.actions.FindByType)7 ElementSearchCriteria (com.testsigma.automator.actions.ElementSearchCriteria)4 ElementPropertiesEntity (com.testsigma.automator.entity.ElementPropertiesEntity)3 MobileElement (com.testsigma.automator.actions.mobile.MobileElement)1