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);
}
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;
}
Aggregations