How to use isRestart method of com.testsigma.automator.drivers.DriverManager class

Best Testsigma code snippet using com.testsigma.automator.drivers.DriverManager.isRestart

Source:TestcaseRunner.java Github

copy

Full Screen

...262 driverManager.startSession(DriverSessionType.TEST_CASE_SESSION, testCaseResult.getId(), Boolean.TRUE);263 driverManager.setRestartDriverSession(Boolean.FALSE);264 } else {265 log.info("Found startNewDriverSession flag to be false. Continuing with the existing driver session.");266 if (driverManager.isRestart()) {267 driverManager.storeSessionId(DriverSessionType.TEST_CASE_SESSION, testCaseResult.getId());268 }269 }270 }271}...

Full Screen

Full Screen

Source:DriverManager.java Github

copy

Full Screen

...34 private Instant sessionStartInstant;35 private Instant sessionEndInstant;36 private String initialSessionId;37 private String restartSessionId;38 private Boolean isRestart = Boolean.FALSE;39 DriverManager() {40 this.executionUuid = EnvironmentRunner.getRunnerExecutionId();41 this.testDeviceEntity = EnvironmentRunner.getRunnerEnvironmentEntity();42 this.executionLabType = testDeviceEntity.getExecutionLabType();43 this.settings = testDeviceEntity.getEnvSettings();44 this.testDeviceSettings = testDeviceEntity.getEnvSettings();45 TestPlanRunSettingEntity executionSettings = testDeviceEntity.getTestPlanSettings();46 this.testDeviceSettings.setElementTimeout(executionSettings.getPageTimeOut());47 this.testDeviceSettings.setPageLoadTimeout(executionSettings.getElementTimeOut());48 }49 public static DriverManager getDriverManager() {50 return _driverManager.get();51 }52 public static void setDriverManager(DriverManager driverManager) {53 _driverManager.set(driverManager);54 }55 public static void getDriverManager(TestDeviceEntity testDeviceEntity,56 WorkspaceType workspaceType, Platform os, Long environmentResultId,57 DriverSessionType driverSessionType) throws AutomatorException {58 DriverManager driverManager = null;59 switch (workspaceType) {60 case WebApplication:61 driverManager = new WebDriverManager();62 break;63 case MobileWeb:64 if (os.equals(Platform.Android)) {65 driverManager = new AndroidWebDriverManager();66 } else {67 driverManager = new IOSWebDriverManager();68 }69 break;70 case AndroidNative:71 driverManager = new AndroidNativeDriverManager();72 break;73 case IOSNative:74 driverManager = new IOSNativeDriverManager();75 break;76 default:77 break;78 }79 if (driverManager != null) {80 DriverManager.setDriverManager(driverManager);81 driverManager.startSession(driverSessionType,82 environmentResultId, Boolean.FALSE);83 }84 }85 public static RemoteWebDriver getRemoteWebDriver() {86 RemoteWebDriver driver = null;87 if (DriverManager.getDriverManager().getDriver() != null) {88 driver = DriverManager.getDriverManager().getDriver().getRemoteWebDriver();89 }90 return driver;91 }92 public boolean isRestart() {93 return this.isRestart;94 }95 public abstract void performCleanUpAction(OnAbortedAction actionType) throws AutomatorException;96 protected abstract RemoteWebDriver createDriverSession() throws AutomatorException, IOException;97 protected void beforeSessionCreateActions() throws AutomatorException {98 log.debug("Executing before create session actions for execution UUID - " + executionUuid);99 sessionStartInstant = Instant.now();100 }101 protected void afterSessionCreateActions()102 throws AutomatorException {103 log.debug("Executing after create session actions for execution UUID - " + executionUuid);104 }105 public void startSession(DriverSessionType driverSessionType, Long entityId, Boolean isRestart) throws AutomatorException {106 RemoteWebDriver remoteWebDriver;107 beforeSessionCreateActions();108 try {109 remoteWebDriver = createDriverSession();110 storeSessionId(driverSessionType, entityId);111 this.isRestart = isRestart;112 if (!isRestart) {113 this.initialSessionId = getSessionId();114 log.info("Initial Session ID:" + this.initialSessionId);115 } else {116 this.restartSessionId = getSessionId();117 log.info("Restarted Session ID:" + this.restartSessionId);118 }119 } catch (Exception e) {120 log.error(e.getMessage(), e);121 String errorMessage = parseErrorMessage(e.getMessage());122 if (StringUtils.isBlank(errorMessage)) {123 errorMessage = AutomatorMessages.EXCEPTION_WEBDRIVER_NOTCREATED + " - " + e.getMessage();124 } else if(e.getMessage().contains("NO_PARALLEL_RUN")){125 errorMessage = AutomatorMessages.NO_PARALLEL_RUNS;126 throw new TestsigmaNoParallelRunException(ErrorCodes.NO_PARALLEL_RUN,errorMessage);...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful