Search in sources :

Example 66 with AutomatorException

use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.

the class CloudAppBridge method getDriverExecutablePath.

@Override
public String getDriverExecutablePath(String browserName, String browserVersion) throws AutomatorException {
    try {
        MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
        queryParams.add("browserName", browserName);
        queryParams.add("browserVersion", browserVersion);
        String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
        String url = ServerURLBuilder.driverExecutableURL(queryParams, agentConfig.getUUID());
        HttpResponse<String> response = webAppHttpClient.get(url, new TypeReference<>() {
        }, authHeader);
        if (response.getStatusCode() != HttpStatus.OK.value()) {
            throw new AutomatorException(response.getStatusMessage());
        }
        return response.getResponseEntity();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new AutomatorException(e.getMessage(), e);
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) LinkedMultiValueMap(org.springframework.util.LinkedMultiValueMap) AutomatorException(com.testsigma.automator.exceptions.AutomatorException)

Example 67 with AutomatorException

use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.

the class CloudAppBridge method updateEnvironmentResultData.

@Override
public void updateEnvironmentResultData(TestDeviceResultRequest testDeviceResultRequest) throws AutomatorException {
    try {
        String url = ServerURLBuilder.environmentResultUpdateURL(testDeviceResultRequest.getId());
        String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
        HttpResponse<String> response = webAppHttpClient.put(url, testDeviceResultRequest, new TypeReference<>() {
        }, authHeader);
        log.info(response.getStatusCode() + " - " + response.getResponseText());
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new AutomatorException(e.getMessage(), e);
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) AutomatorException(com.testsigma.automator.exceptions.AutomatorException)

Example 68 with AutomatorException

use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.

the class CloudAppBridge method updateElement.

@Override
public void updateElement(String name, ElementRequestEntity elementRequestEntity) throws AutomatorException {
    try {
        String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
        HttpResponse<ElementEntity> response = webAppHttpClient.put(ServerURLBuilder.elementURL(name), elementRequestEntity, new TypeReference<>() {
        }, authHeader);
        log.info("Element update response - " + response);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new AutomatorException(e.getMessage(), e);
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) AutomatorException(com.testsigma.automator.exceptions.AutomatorException)

Example 69 with AutomatorException

use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.

the class CloudAppBridge method updateRunTimeData.

@Override
public void updateRunTimeData(Long environmentResultId, RuntimeEntity runtimeEntity) throws AutomatorException {
    try {
        MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
        queryParams.add("environmentResultId", environmentResultId.toString());
        String url = ServerURLBuilder.runTimeNewDataURL(queryParams);
        String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
        webAppHttpClient.put(url, runtimeEntity, null, authHeader);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new AutomatorException(e.getMessage(), e);
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) LinkedMultiValueMap(org.springframework.util.LinkedMultiValueMap) AutomatorException(com.testsigma.automator.exceptions.AutomatorException)

Example 70 with AutomatorException

use of com.testsigma.automator.exceptions.AutomatorException in project testsigma by testsigmahq.

the class CloudAppBridge method postTestCaseResult.

@Override
public void postTestCaseResult(TestCaseResult testCaseResult) throws AutomatorException {
    try {
        String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
        webAppHttpClient.put(ServerURLBuilder.testCaseResultURL(testCaseResult.getId()), testCaseResult, null, authHeader);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new AutomatorException(e.getMessage(), e);
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) AutomatorException(com.testsigma.automator.exceptions.AutomatorException)

Aggregations

AutomatorException (com.testsigma.automator.exceptions.AutomatorException)119 TimeoutException (org.openqa.selenium.TimeoutException)31 WebElement (org.openqa.selenium.WebElement)19 IOException (java.io.IOException)12 ArrayList (java.util.ArrayList)9 Select (org.openqa.selenium.support.ui.Select)6 TestsigmaException (com.testsigma.agent.exception.TestsigmaException)5 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 RuntimeDataProvider (com.testsigma.automator.utilities.RuntimeDataProvider)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 Map (java.util.Map)3 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)3 LinkedMultiValueMap (org.springframework.util.LinkedMultiValueMap)3 PathNotFoundException (com.jayway.jsonpath.PathNotFoundException)2 ElementNotDisplayedException (com.testsigma.automator.actions.exceptions.ElementNotDisplayedException)2 MobileApp (com.testsigma.automator.mobile.MobileApp)2 ObjectMapperService (com.testsigma.automator.service.ObjectMapperService)2 ErrorUtil (com.testsigma.automator.utilities.ErrorUtil)2 File (java.io.File)2 MalformedURLException (java.net.MalformedURLException)2