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
1,786 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
337 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
• 28,040 points
7,387 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
9,423 views
+10 votes
17 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,360 points
149,386 views
0 votes
2 answers

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,500 points
6,024 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
6,458 views
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
4,086 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
5,058 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
1,271 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
341 views