Search in sources :

Example 1 with FindByType

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

Example 2 with FindByType

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

Example 3 with FindByType

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

Example 4 with FindByType

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

Example 5 with FindByType

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

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