Thread.Sleep is better then using WebDriverWait/Implicitly or Explictly ?

10,799 views
Skip to first unread message

Abu Hamzah

unread,
Oct 18, 2012, 11:34:26 AM10/18/12
to seleniu...@googlegroups.com

What is the best way to use I have been getting Timeout exception and below is the code I am using to FindElement.

if i use Thread.Sleep(8000) or 6000 its working as excepted but Its scattered all over my code and its hard to maintain ... is there any elegant solution for this problem?

    public IWebElement GetFindElement(By locator)
    {
        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
        IWebElement myDynamicElement = wait.Until<IWebElement>((d) =>
        {
            return d.FindElement(locator);
        });
        return myDynamicElement;
    }

simon qiu

unread,
Oct 18, 2012, 11:37:44 AM10/18/12
to seleniu...@googlegroups.com
There are three ways I know:
1. driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
2. WebDriverWait
3. Thread.sleep(8000);

2012/10/18 Abu Hamzah <abuha...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/oEM90wjhcLkJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

sirus tula

unread,
Oct 18, 2012, 11:48:29 AM10/18/12
to seleniu...@googlegroups.com
The worst way to wait is Thread.Sleep.
 
The best way for time wait is to wait until your expected element is present or displayed so it doesn't depend on any time. Once it finds your expected element, it will keep running making your execution faster and smoother. If it doesn't find in 20 secs, it throws an error as expected.
 
//use this method in your common script file.
 
 
 //this method waits until your expected element is present. If the expected element is not present in 20 secs, it throws an error.

        public void waitforElement(By by)
        {
            for (int second = 0; ; second++)
            {
                if (second >= 20)     
                {
                    Assert.Fail("Timeout in the page: " + driver.Title);
                }
                else
                {
                    try
                    {
                        driver.FindElement(by);
                        break;
                    }
                    catch
                    {
                    }
                    Thread.Sleep(1000);
                }
            }
        }

Then you can call this method in any of your tests using the reusability feature. No repitition involved.
Common.waitforElement(By.CssSelector(<"elementid">));
 
Hope that helps!
--
 
- "If you haven't suffered, you haven't lived your life."
 
Thanks,
 
Sirus

Abu Hamzah

unread,
Oct 18, 2012, 11:48:59 AM10/18/12
to seleniu...@googlegroups.com
i have discouraged to use Thread.Sleep just checking to hear from others if this really matters?, to me seems like thread.sleep is more reliable then the other two
any thoughts?

Jim Evans

unread,
Oct 18, 2012, 12:13:24 PM10/18/12
to seleniu...@googlegroups.com
Yes, it really matters. Consider a case from your own example. You mentioned that you have some occurrences of Thread.Sleep(8000) in your tests. That's sleeping for 8 seconds. Every. Single. Time. What happens if the element you're looking for is present in the page after 2 seconds? You're waiting an extra 6 seconds that you don't have to. That may not sound like much, but consider when you have 100 tests that all do the same thing. Now your test suite runs 10 minutes longer than it needs to. When you expand that to 1000 tests, your suite runs over an hour and a half longer than it should. Speed matters, even (especially?) in test code.

Incidentally, the "waitForElement()" function posted earlier in the thread is almost identical to the implementation of WebDriverWait. If you want to go about reinventing the wheel, feel free, but I'd much rather avoid that in my code if possible.

simon qiu

unread,
Oct 18, 2012, 12:25:52 PM10/18/12
to seleniu...@googlegroups.com
+1 for this way.

2012/10/18 sirus tula <selenium...@gmail.com>

Abu Hamzah

unread,
Oct 18, 2012, 1:24:33 PM10/18/12
to seleniu...@googlegroups.com
Jim,

yes I tried several attempts to use but  some times I get webelement not found and some time works, some times not

here is the code i am using for, please correct me if i am not using correctly.

 public IWebElement WaitForElement(By by)
        {
            int seconds = 30;

            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(seconds));
            IWebElement myDynamicElement = wait.Until<IWebElement>((d) =>
            {
                return d.FindElement(by);
            });
            return myDynamicElement;

Abu Hamzah

unread,
Oct 18, 2012, 1:38:18 PM10/18/12
to seleniu...@googlegroups.com
here is the error i am getting if i use the WebDriverWait method - please see my other post for the code:

Error 1 Test 'UnitTest.Retrieve_Match' failed: Test method UnitTest.Retrieve_Match threw exception: 
OpenQA.Selenium.StaleElementReferenceException: Element is no longer valid
    at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 957
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 809
   at OpenQA.Selenium.Remote.RemoteWebElement.get_Selected() in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebElement.cs:line 130
   at OpenQA.Selenium.Support.UI.SelectElement.SelectByText(String text) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver.Support\UI\SelectElement.cs:line 139
   at selenium.framework.SeleniumPageBase.SelectText(By locator, String txt) in C:\appsSeleniumPageBase.cs:line 164
   at selenium.framework.SeleniumPageElement.SelectCategoryMaingPage() in C:\appsSeleniumPageElement.cs:line 700
   at selenium.framework.Retrieved_Matched() in C:\appseCeC8.cs:line 98
   at UnitTest.Retrieve_Match() in C:\apps_UnitTest.cs:line 24 C:\appsSeleniumPageBase.cs 164



On Thursday, October 18, 2012 11:13:24 AM UTC-5, Jim Evans wrote:

Jim Evans

unread,
Oct 18, 2012, 1:43:25 PM10/18/12
to seleniu...@googlegroups.com
That's a completely different problem than the element not being found. WebDriverWait is finding an element that matches your criteria, but by the time you attempt to use it in your other code (it looks like you're trying to get the .Selected property), the element has been removed from the DOM or the page has refreshed. You'll need to figure out how to synchronize your code with the DOM being refreshed.

Abu Hamzah

unread,
Oct 18, 2012, 1:49:07 PM10/18/12
to seleniu...@googlegroups.com
hmmm.. if that's the case then why it is working with thread.sleep ? i am still trying to wrap my head around with web element not found

Abu Hamzah

unread,
Oct 18, 2012, 2:08:32 PM10/18/12
to seleniu...@googlegroups.com
sorry, its not completely different but the part of the problem what i see is related with waiting to find an element and as i said in my previous post that if i use thread.sleep for few seconds then i able to find the element and if i just use webdriverwait then everything is fall a part which is more frustrated and annoyed with and i have tried all four (webdriverwait, implicitly, explictly and thread.sleep) and thread.sleep found more reliable then other three options.....

any help and like to use what is best practice instead of hacking the code...


On Thursday, October 18, 2012 12:43:25 PM UTC-5, Jim Evans wrote:

Jim Evans

unread,
Oct 18, 2012, 4:02:05 PM10/18/12
to seleniu...@googlegroups.com
I know from your point of view, you're just calling FindElement(), so it looks like it's all related to finding an element, and it all looks like the same problem, but they *are* different problems. You're not getting a NoSuchElementException, you're getting a StaleElementReference exception. Exception types matter. You're finding an element meeting your criteria, just not the element you *think* you're finding. I suspect what's happening when you're using WebDriverWait is the following:

1. Some action starts that will refresh the DOM (an element click or similar)
2. Your WebDriverWait executes, finding the element before the DOM refresh happens
3. The DOM refreshes
4. You attempt to use the element found with WebDriver wait, which is no longer valid/attached to the DOM, so you get a StaleElementReferenceException.

When you use Thread.Sleep, here's what happens:

1. You execute the action to refresh the DOM
2. You sleep for a hard-coded length of time, long enough for the DOM refresh to complete
3. You find the element
4. You can use the element, because it is validly connected to the current DOM

Like I said before, you'll need to find a way to synchronize on the DOM refresh before finding the element.

Mike Riley

unread,
Oct 18, 2012, 4:35:46 PM10/18/12
to seleniu...@googlegroups.com
To expand on that, you would look for a new element appearing, or something disappearing, or something becoming visible that was hidden previously (or vice-versa).  That way you will know the refresh of the DOM has occurred

Mike

Mark Collin

unread,
Oct 18, 2012, 4:56:00 PM10/18/12
to seleniu...@googlegroups.com

You are missing one of the big reasons to not use Thread.sleep, all computers are different specs and different speeds, a sleep of 8 seconds may be enough time on your computer, but put it on one that is half as powerful and the tests will never pass.

To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/J7g_syL7LvAJ.

Message has been deleted

Abu Hamzah

unread,
Oct 18, 2012, 7:00:10 PM10/18/12
to seleniu...@googlegroups.com
Thank you very much for the detail response.

I forgot to tell you that, it does refresh the page before i start selecting a different element

so i have two dropdownlist and both do the postback meaning refresh the page

so for the first dropdownlist i do not have problem selecting the selectText from the dropdownlist but when my code try to select the second dropdownlist then it throws an error after debuggin my code i found that, once i select the first dropdownlist the page is refreshing ....

how to find a way to synchronize on the DOM .... where/how should i start looking any clue?
Message has been deleted

simon qiu

unread,
Oct 18, 2012, 7:05:01 PM10/18/12
to seleniu...@googlegroups.com
refer to this  https://groups.google.com/forum/#!topic/selenium-users/u7HEjD3NO5Q/discussion  ?

2012/10/19 Abu Hamzah <abuha...@gmail.com>
Thank you very much for the detail response.

I forgot to tell you that, it does refresh the page before i start selecting a different element

so i have two dropdownlist and both do the postback meaning refresh the page

so for the first dropdownlist i do not have problem selecting the selectText from the dropdownlist but when my code try to select the second dropdownlist then it throws an error after debuggin my code i found that, once i select the first dropdownlist the page is refreshing ....

how to find a way to synchronize on the DOM .... where/how should i start looking any clue?


To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/TDTvbP2LI6cJ.

Abu Hamzah

unread,
Oct 18, 2012, 9:07:29 PM10/18/12
to seleniu...@googlegroups.com
Thanks Simon, but the OP does not tell how exactly he solved his problem and i see the thread is exactly what i am going through.


how would i go creating my own Wait class, any help?

Jim Evans

unread,
Oct 18, 2012, 10:19:06 PM10/18/12
to seleniu...@googlegroups.com
Subclass DefaultWait<T>. Or you could customize your WebDriverWait instance. The WebDriverWait class has properties and methods for customizing almost everything about the wait, from the total wait timeout, to how often it polls for the condition, to what exceptions it will ignore when executing the Until() method.

Abu Hamzah

unread,
Oct 18, 2012, 10:32:50 PM10/18/12
to seleniu...@googlegroups.com
Jim, 

I am still learning the webdriver api so bare with me if I annoy you with my questions :)... can you please throw some lines of code to get an idea? I am not sure what to implement. - thanks.

Abu Hamzah

unread,
Oct 18, 2012, 11:16:37 PM10/18/12
to seleniu...@googlegroups.com
okay so i come-up with this code after reading and goggling but still does not work ERGGGGGGGGG

 public IWebElement WaitForElement(By by)
 {
            // Tell webdriver to wait
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));
            wait.PollingInterval = TimeSpan.FromSeconds(2);
            wait.IgnoreExceptionTypes(typeof(NoSuchElementException), typeof(NoSuchFrameException));
            wait.IgnoreExceptionTypes(typeof(StaleElementReferenceException), typeof(StaleElementReferenceException));

            IWebElement myWait = wait.Until(x => x.FindElement(by));
            return myWait;
}

please have a look.

Mark Collin

unread,
Oct 19, 2012, 1:36:01 AM10/19/12
to seleniu...@googlegroups.com

In your situation I would be using the page factory stuff in the support packages, unfortunately the stuff I have is quite Java specific and I don’t know what the equivalent code would be in .NET.  The below may help or it may not be relevant to your specific language binding:

 

http://code.google.com/p/selenium/wiki/PageFactory

 

The advantage of using a page factory is that the element is found again every time you use it (unless you specifically cache it) so you should no longer see StaleReferenceElementExceptions.

 

This came up on the Selenium blog a while back and is supposed to be a C# implementation based around page objects so may be of some use to you:

 

http://teststack.github.com/TestStack.Seleno/

 

 

From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Abu Hamzah
Sent: 19 October 2012 04:17
To: seleniu...@googlegroups.com
Subject: Re: [selenium-users] Thread.Sleep is better then using WebDriverWait/Implicitly or Explictly ?

 

okay so i come-up with this code after reading and goggling but still does not work ERGGGGGGGGG

--

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Acg60O3u_20J.

Abu Hamzah

unread,
Oct 19, 2012, 9:26:57 AM10/19/12
to seleniu...@googlegroups.com
I am using page factory for like button, link, but how would you use for selecting a text from the dropdownlist?

Moises Siles

unread,
Oct 19, 2012, 10:34:04 AM10/19/12
to seleniu...@googlegroups.com
Sorry, to interrupt in the middle of the conversation, but what is the default value for this one

how often it polls for the condition

On Thu, Oct 18, 2012 at 8:19 PM, Jim Evans <james.h....@gmail.com> wrote:
Subclass DefaultWait<T>. Or you could customize your WebDriverWait instance. The WebDriverWait class has properties and methods for customizing almost everything about the wait, from the total wait timeout, to how often it polls for the condition, to what exceptions it will ignore when executing the Until() method.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DFFLDgY1d94J.

Moises Siles

unread,
Oct 19, 2012, 10:45:39 AM10/19/12
to seleniu...@googlegroups.com
I was talking about this

PollingInterval value

Jim Evans

unread,
Oct 19, 2012, 11:25:26 AM10/19/12
to seleniu...@googlegroups.com
A quick look at the source code[1] shows that it's every 500 milliseconds.

[1] http://selenium.googlecode.com/svn/trunk/csharp/src/WebDriver.Support/UI/WebDriverWait.cs

Hien Ngo

unread,
Oct 19, 2012, 11:26:08 AM10/19/12
to seleniu...@googlegroups.com
My understanding from the code is:
He implemented this line:   WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));
so the Polinginterval is defaulted to 500ms.
The overload WebDriverWait() can take a 3rd param, and that is where the Polinginterval is.

Abu Hamzah

unread,
Oct 19, 2012, 12:18:22 PM10/19/12
to seleniu...@googlegroups.com
I have implemented this:

             WebDriverWait wait = new WebDriverWait(new SystemClock(), driver, TimeSpan.FromSeconds(30), TimeSpan.FromMilliseconds(100));
                wait.PollingInterval = TimeSpan.FromSeconds(5);
                wait.IgnoreExceptionTypes(typeof(NoSuchElementException));
                wait.IgnoreExceptionTypes(typeof(StaleElementReferenceException));
                wait.IgnoreExceptionTypes(typeof(InvalidSelectorException));

I still get the error:

System.NotImplementedException: Element is no longer valid
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.get_Text()

Abu Hamzah

unread,
Oct 20, 2012, 7:58:20 AM10/20/12
to seleniu...@googlegroups.com
anybody?

Mark Collin

unread,
Oct 20, 2012, 10:56:30 AM10/20/12
to seleniu...@googlegroups.com

Can you show me the test and the page factoryyou are currently using

To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/V6Bb2CBRfbUJ.

Abu Hamzah

unread,
Oct 22, 2012, 8:41:20 PM10/22/12
to seleniu...@googlegroups.com
Anand: do you call this method (Exists) before finding an element?  i dont see how you repeating here... did you miss some code?

On Saturday, October 20, 2012 4:41:06 PM UTC-4, Anand T wrote:
Hi,

I am not sure if this could help you but could not resist myself from posting this.

I use  driver.findelements(bysomething) if not found then wait for few seconds and then repeat the same statement if element not found then fail the test as there will be no errors or exceptions will be reported code snippet below.

public static boolean exists(By elementExpr){
try {
status2=false;
getDriver().manage().timeouts().implicitlyWait(0, TimeUnit.MILLISECONDS);
status2= Elements(elementExpr).size() != 0;
getDriver().manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
}catch (WebDriverException e) {
writeLogs("Element Search Failed :" + e.getMessage());
Assert.fail("Element Search Failed - Exception :" + e.getMessage());

} finally{
}
return status2;
}

Thanks,
Anand

Abu Hamzah

unread,
Oct 22, 2012, 10:46:02 PM10/22/12
to seleniu...@googlegroups.com
>>Subclass DefaultWait<T>. Or you could customize your WebDriverWait instance. The WebDriverWait class has properties and methods for customizing almost everything about the wait, from the total wait timeout, to how often it polls for the condition, to what exceptions it will ignore when executing the Until() method.
>>>>

will you show me how to achieve what what you have suggested? I am still having the timing problem and its very frustrated and I hope if you can show me the right direction - thanks.

Jim Evans

unread,
Oct 22, 2012, 11:19:30 PM10/22/12
to seleniu...@googlegroups.com
Without knowing the exact code for the page you're running against, no, I can't help you any further. I've explained exactly what the issue is. You're finding the element before the DOM refreshes, so when you try to use it, it's stale. You'll need to find a way, within the context of the application you're automating, to account for the behavior. I wish I had a better, one-size-fits-all, just-do-this-and-I-guarantee-it-will-work-100%-of-the-time solition, but I don't. There may be someone in the community who can provide you with that level of code without intimate knowedge of your application code, but I'm not it.

Shaba K

unread,
Oct 23, 2012, 11:35:42 AM10/23/12
to seleniu...@googlegroups.com
Most of us end up in this situation.

Here's what i did .. may be some one must've already mentioned.

 public static IWebElement FindElement(this Drivercontext context, By by, int timeoutInSeconds)
        {
            if (timeoutInSeconds > 0)
            {
                var wait = new WebDriverWait(context.GetDriver(), TimeSpan.FromSeconds(timeoutInSeconds));
                return wait.Until(drv => drv.FindElement(by));
            }
            return context.GetDriver().FindElement(by);
        }


Also,if  your webpage uses lot of jQuery .. 

You can set a flag to see if the jQuery has finished loading the page.

Hope it helps 

Cheers,
S



On Tue, Oct 23, 2012 at 4:19 AM, Jim Evans <james.h....@gmail.com> wrote:
Without knowing the exact code for the page you're running against, no, I can't help you any further. I've explained exactly what the issue is. You're finding the element before the DOM refreshes, so when you try to use it, it's stale. You'll need to find a way, within the context of the application you're automating, to account for the behavior. I wish I had a better, one-size-fits-all, just-do-this-and-I-guarantee-it-will-work-100%-of-the-time solition, but I don't. There may be someone in the community who can provide you with that level of code without intimate knowedge of your application code, but I'm not it.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/a2xx3XqWNnUJ.

Abu Hamzah

unread,
Oct 23, 2012, 12:56:54 PM10/23/12
to seleniu...@googlegroups.com
how you checking the timeoutInSeconds, i think you calling FindElement after looping or something? can you show me the full code please?

How you using Drivercontext? is that driver create 
is that something you doing like this?
var driver = new FirefoxDriver();

here is the code I am creating my webdriver for firefox and IE
http://nizarnoorani.com/writing-integration-tests-for-asp-net-with-selenium-2-0-part-2

Shaba K

unread,
Oct 23, 2012, 2:59:41 PM10/23/12
to seleniu...@googlegroups.com
it's not looping at all ..

We pass a value in seconds .. if the element is not rendered in that specified time .. then it fails ...

for ex : usage is

FindElement(context, By.LinkText("Sometext "), 30);

Yeah, you guessed right about context.

Cheers,
S

To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/cfdXMa0COWYJ.

Ken MacMurray

unread,
Oct 1, 2013, 11:28:44 AM10/1/13
to seleniu...@googlegroups.com
+1 for this response. 
I've tried nearly every combination of viable solutions when working with a very dynamic application with a lot of "ajax-y" events occurring on the page. From my experience it has worked best to first attempt a solution using only WebDriverWait, using discretion to set the timeout period. Then, if that's not working, a fix that nearly always does it is calling a very short Thread.sleep just before I attempt to grab that tricky element that just won't cooperate with simply WebDriverWait. Still always use WebDriverWait to get a hold on every element, but insert a maximally short Thread.sleep before elements that just do not want to cooperate. 

Alan Holt

unread,
Jul 23, 2014, 1:08:57 PM7/23/14
to seleniu...@googlegroups.com
Why not use implicitWait?  WebDriver has built-in functionality to wait for an element to appear.

public WebElement findElement(By by){
_driver.manage().timeouts().implicitlyWait(20000, TimeUnit.MILLISECONDS);
long startMs = System.currentTimeMillis();
WebElement element = _driver.findElement(by);
long endMs = System.currentTimeMillis();
long searchTime = endMs - startMs;
if(searchTime >= 10000){
log().debug("Item Found.  Search Time: " + searchTime + "ms.");
}
return element;
}

The above method will attempt to find the Element based on the passed By, with a timeout up to 20 seconds.  It also tracks the search time and prints out a message if it takes longer than half of the timeout to find the element.  This allows a test engineer (or manual QA) to look at the log of the tests and pick out areas of the application where load time might be an issue, without having to utilize a load/performance testing suite.

deep....@gmail.com

unread,
Oct 25, 2017, 11:22:00 PM10/25/17
to Selenium Users
Abu,

         You are write. when i use implicit wait or explicit wait some time there is chances to get test failed but not with thread.sleep() in my case.  My colleague always say it's not a best practice to use thread.sleep. 

sundari sundu

unread,
Oct 31, 2017, 12:05:44 AM10/31/17
to Selenium Users
we can use WrbDriverWait all the time..
WebDriverWait wait = new WebDriverWait(driver,30000);
wait.until(ExpectedConditions.Visbilityof(driver.findElement(By.id(""))));
element.click(); // based on ur choice

but only one problem is, before finding this element also sometimes driver may need some wait time so you can give like,
Thread.sleep(2000);
before the above code..

Otherwise if you completely depend on thread.sleep it will reduce the performance of your code.. Even after finding the element it will wait for the certain no of milliseconds that we give.. This is how I did to get my code worked.. It works well without any issues..
It will not wait for much time and finds the element fastly also..
Reply all
Reply to author
Forward
0 new messages