Search in sources :

Example 1 with MobileElement

use of com.testsigma.automator.actions.mobile.MobileElement 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 2 with MobileElement

use of com.testsigma.automator.actions.mobile.MobileElement in project testsigma by testsigmahq.

the class DriverSessionActionsController method getPageSource.

/**
 * Gets the page source of the current page
 *
 * @param sessionId
 * @return MobileElementDTO - A tree structure of page element
 * @throws MobileAutomationServerCommandExecutionException
 */
@GetMapping(value = "/page_source", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public MobileElementDTO getPageSource(@PathVariable("session_id") String sessionId, @RequestParam("platform") Platform platform) throws MobileAutomationServerCommandExecutionException {
    log.info("Request for page source in session - " + sessionId + " Platform - " + platform);
    MobileElement mobileElement = driverSessionCommand.pageSourceElements(sessionId, platform);
    MobileElementDTO mobileElementDTO = mobileElementMapper.map(mobileElement);
    return mobileElementDTO;
}
Also used : MobileElement(com.testsigma.automator.actions.mobile.MobileElement) MobileElementDTO(com.testsigma.agent.dto.MobileElementDTO)

Aggregations

MobileElement (com.testsigma.automator.actions.mobile.MobileElement)2 MobileElementDTO (com.testsigma.agent.dto.MobileElementDTO)1 ElementSearchCriteria (com.testsigma.automator.actions.ElementSearchCriteria)1 FindByType (com.testsigma.automator.actions.FindByType)1