How to find the element that displays and hides with in 2 seconds in selenium webdriver?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to find the element that displays and hides with in 2 seconds in selenium webdriver?

Masood Ahmad

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e2e01b8a-7373-4a4c-8902-0cbfdb5146ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to find the element that displays and hides with in 2 seconds in selenium webdriver?

total QA
Hi ,

One way is  keep on polling for the Element using Explicit Wait by adding try catch block.

Logic:
                     for(int i=0;i<5;i++)
                    {
                               try{
                                              //find the element;
                                               if element is displayed
                                               break;
                               }
                                catch(Exception e)
                               {

                              }
                          Thread.sleep(1000);
                  }

Regards,

Latest Posts: 


On Thursday, June 21, 2018 at 6:03:44 PM UTC+5:30, Masood Ahmad wrote:

<a href="https://sqa.stackexchange.com/questions/7743/how-to-find-the-element-that-displays-and-hides-with-in-2-seconds-in-selenium-we" style="margin-bottom:0.5em;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:1.35;font-family:inherit;font-size:20px;vertical-align:baseline;color:rgb(24,82,154)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsqa.stackexchange.com%2Fquestions%2F7743%2Fhow-to-find-the-element-that-displays-and-hides-with-in-2-seconds-in-selenium-we\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEjoRb1R0NOgJWyH2pPKeqSqdFvPQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsqa.stackexchange.com%2Fquestions%2F7743%2Fhow-to-find-the-element-that-displays-and-hides-with-in-2-seconds-in-selenium-we\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEjoRb1R0NOgJWyH2pPKeqSqdFvPQ&#39;;return true;">How to find the element that displays and hides with in 2 seconds in selenium WebDriver?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/579a291f-e304-4e62-906e-157eb5c5c4ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.