Login window session expiry using Selenium

0 votes

I am testing my application. after testing for couple of minutes session expires and login window pops up. Session is expiring randomly hence I don't have any fixed point to stop and resume. My test case also starts failing as expected button is on the main window which become inactive after login window comes up.

Any suggestions how to fix this?

Jul 13, 2018 in Selenium by Martin
• 4,210 points
82 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The details you can find in below link:-

http://toolsqa.com/selenium-webdriver/retry-failed-tests-testng/

Just write a function in a retry, which checks if the pop-up appears then it calls your login function.

Try to use retryAnalyzer of TestNG
 

import org.testng.Assert;

import org.testng.annotations.Test;


public class Test001 {


@Test(retryAnalyzer = Tests.RetryAnalyzer.class)

public void Test1()

{

    Assert.assertEquals(false, true);

}


@Test

public void Test2()

{

    Assert.assertEquals(false, true);

}

}

answered Jul 13, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer

Login popup window using selenium webdriver?

Follow this steps: 1) Open the FireFox browser 2) ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,400 points
40 views
0 votes
1 answer

Handling new window using Selenium

You are not switching to new window. ...READ MORE

answered Apr 2, 2018 in Selenium by DragonLord999
• 8,360 points
1,083 views
0 votes
1 answer

Login page test script using selenium and java in Eclipse IDE

Here is an example to login to ...READ MORE

answered Apr 23, 2018 in Selenium by Meci Matt
• 9,400 points
1,318 views
+9 votes
13 answers

How to automate gmail login process using selenium webdriver in java?

Check the below code: Here is the working ...READ MORE

answered Apr 24, 2018 in Selenium by Vardy
• 2,280 points
35,904 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,030 points
69 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
438 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
54 views
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,130 points
156 views
0 votes
1 answer

Maximizing the browser window in Selenium WebDriver using C#

Check this first: http://code.google.com/p/selenium/issues/detail?id=174 You Can use the JavascriptExector as follows: public ...READ MORE

answered May 2, 2018 in Selenium by Samarpit
• 5,130 points
45 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.