How to use onFinish method of com.paypal.selion.internal.platform.grid.SeleniumGridListener class

Best SeLion code snippet using com.paypal.selion.internal.platform.grid.SeleniumGridListener.onFinish

Source:SeleniumGridListener.java Github

copy

Full Screen

...268 }269 /**270 * Closes selenium session when suite finished to run271 * 272 * @see org.testng.ISuiteListener#onFinish(org.testng.ISuite)273 */274 @Override275 public void onFinish(ISuite suite) {276 logger.entering(suite);277 if (ListenerManager.executeCurrentMethod(this) == false) {278 logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);279 return;280 }281 if (sessionMap != null && !sessionMap.isEmpty()) {282 if (logger.isLoggable(Level.FINE)) {283 logger.log(Level.FINE, "Thread " + Thread.currentThread().getId() + " finished Suite, Open Sessions = "284 + sessionMap.toString());285 }286 // This is NOT an optimal solution. But we need to find out some way to clear out all those sessions287 // which we ended up persisting or else the browser instances wont be cleaned up.288 Class<?>[] supportedAnnotations = TestSessionFactory.getSupportedAnnotations();289 for (Class<?> eachAnnotation : supportedAnnotations) {290 AbstractTestSession config = TestSessionFactory.newInstance(eachAnnotation);291 if (config.handleSessions()) {292 config.closeAllSessions(sessionMap);293 }294 }295 }296 LocalGridManager.shutDownHub();297 logger.exiting();298 }299 /**300 * 301 * @see org.testng.ISuiteListener#onFinish(org.testng.ISuite)302 */303 @Override304 public void onFinish(ITestContext context) {305 // Below conditional check needs to be invoked in all TestNG Listener interface implementation.306 // Failing to do so can have un-predictable results.307 if (ListenerManager.executeCurrentMethod(this) == false) {308 logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);309 return;310 }311 return;312 }313 /**314 * On start each suite initialize config object and report object315 */316 @Override317 public void onStart(ITestContext context) {318 logger.entering(context);...

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