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,330 points
915 views

1 answer to this question.

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,890 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,460 points
192 views
0 votes
2 answers

Handling new window using Selenium

You can try something like this too:  ...READ MORE

answered Aug 27, 2019 in Selenium by Abha
• 27,910 points
4,751 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,460 points
5,317 views
+9 votes
15 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,370 points
110,509 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,510 points
2,902 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,890 points
2,238 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,890 points
2,369 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,890 points
668 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,890 points
166 views