use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class DeviceContainer method syncBrowserDrivers.
public void syncBrowserDrivers(MobileDevice mobileDevice) {
log.info("Syncing Browser Drivers For Mobile Devices - " + mobileDevice);
List<AgentBrowser> browserList = mobileDevice.getBrowserList();
if (browserList == null) {
return;
}
for (AgentBrowser browserObj : browserList) {
try {
log.info("Trying to sync driver for mobile browser - " + browserObj);
OsBrowserType browserType = browserObj.getName();
String browserVersion = browserObj.getMajorVersion() + "";
Browsers browser = OsBrowserType.getBrowserType(browserType);
String driverPath = AutomatorConfig.getInstance().getAppBridge().getDriverExecutablePath(browser.getKey(), browserVersion);
new DriversUpdateService().syncBrowserDriver(browserType, browserVersion, driverPath);
} catch (AutomatorException e) {
log.error(e.getMessage(), e);
}
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class DriverSessionsController method createSession.
/**
* Create a remote web driver session using selenium/appium
*
* @param driverSessionRequest
* @return created remote web driver sessionId
* @throws Exception
*/
@PostMapping
@ResponseBody
public DriverSessionDTO createSession(@RequestBody DriverSessionRequest driverSessionRequest) throws Exception {
log.debug("Creating a remote web driver session for - " + driverSessionRequest.getUniqueId() + " ( " + driverSessionRequest + ") ");
if (driverSessionRequest.getMobileSessionId() != null) {
try {
String sessionId = driverSessionsService.createSession(driverSessionRequest);
DriverSessionDTO driverSessionDTO = new DriverSessionDTO();
driverSessionDTO.setSessionId(sessionId);
driverSessionDTO.setHostname(AgentService.getComputerName());
return driverSessionDTO;
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new AutomatorException(e.getMessage(), e);
}
} else {
throw new TestsigmaException("Failed creating driver session: mobileSessionId is NULL");
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class RestAPIRunTimeDataProcessor method updateRequestAuthorizationRuntimeValues.
private void updateRequestAuthorizationRuntimeValues() throws AutomatorException {
log.debug("Updating Run time Data in Authorization data, RestStep ID:" + restfulStepEntity.getId());
try {
String updatedAuthData = replaceRuntimeVariables(restfulStepEntity.getAuthorizationValue());
restfulStepEntity.setAuthorizationValue(updatedAuthData);
} catch (AutomatorException e) {
throw new AutomatorException("Error while replacing runtime variables in Request's Authorization field." + e.getMessage());
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class RestAPIRunTimeDataProcessor method updateRequestBodyRuntimeValues.
private void updateRequestBodyRuntimeValues() throws AutomatorException {
log.debug("Updating Body runtime data for rest step:" + restfulStepEntity.getId());
try {
String updatedPayload = replaceRuntimeVariables(restfulStepEntity.getPayload());
restfulStepEntity.setPayload(updatedPayload);
} catch (AutomatorException e) {
throw new AutomatorException("Error while replacing runtime variables in request body." + e.getMessage());
}
}
use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.
the class RestAPIRunTimeDataProcessor method updateRequestHeadersRuntimeValues.
private void updateRequestHeadersRuntimeValues() throws AutomatorException {
log.debug("Updating header run time data for Rest Step:" + restfulStepEntity.getId());
try {
String updatedRequestHeaders = replaceRuntimeVariables(restfulStepEntity.getRequestHeaders());
restfulStepEntity.setRequestHeaders(updatedRequestHeaders);
} catch (AutomatorException e) {
throw new AutomatorException("Error while replacing runtime variables in request Headers." + e.getMessage());
}
}
Aggregations