use of com.sebuilder.interpreter.factory.ScriptFactory.SuiteException in project Asqatasun by Asqatasun.
the class ScenarioLoaderImpl method run.
@Override
public void run() {
try {
LOGGER.debug("Launch Scenario " + scenario);
FirefoxProfile firefoxProfile;
if (isScenarioOnlyLoadPage(scenario)) {
LOGGER.debug("Audit page script");
firefoxProfile = profileFactory.getOnlineProfile();
} else {
LOGGER.debug("Scenario script, images are loaded and implicitly " + "wait timeout set");
implicitelyWaitDriverTimeout = SCENARIO_IMPLICITELY_WAIT_TIMEOUT;
firefoxProfile = profileFactory.getScenarioProfile();
}
Script script = getScriptFromScenario(scenario, firefoxProfile);
try {
if (script.run()) {
LOGGER.debug(webResource.getURL() + " succeeded");
} else {
LOGGER.debug(webResource.getURL() + " failed");
}
} catch (TestRunException tre) {
// The TestRunException is caught but not as runtime, to audit
// at least pages already fetched
LOGGER.warn(tre.getMessage());
} catch (RuntimeException re) {
LOGGER.warn(re.getMessage());
throw new ScenarioLoaderException(re);
}
profileFactory.shutdownFirefoxProfile(firefoxProfile);
} catch (IOException | JSONException | SuiteException ex) {
LOGGER.warn(ex.getMessage());
throw new ScenarioLoaderException(ex);
}
}
Aggregations