| || |
Issue with webdriver and visual studio
I'm having this issue for quite some time now. I have a script in C# and i'm running it in visual studio. The problem is that the script does not fully run. After navigating through the first few pages the script just stops running without throwing any error as if it has run successfully through all the pages. The AUT has a lot of ajax calls however i'm using a method as shown below to make sure that the script waits for the ajax calls to end. i'm calling the method before performing almost any action on the AUT. the script exits out in different places but usually after navigating the first 1 to 2 pages. the script does run correctly when I step through each line of the code.
Can someone please help me figure out where the issue might lie? PLease let me know i any further information is required.
browser used: FF3.6.24
public static void WaitForAjax(IWebDriver driver)
String currentWindowHandle = driver.CurrentWindowHandle;
foreach (string handles in driver.WindowHandles)
if (!driver.WindowHandles.Equals(currentWindowHandle) )
String popupWindowHandle = driver.CurrentWindowHandle;
Re: Issue with webdriver and visual studio
Did you manage to solve this?
To be honest I would never consider an Ajax action to be completely finished until I saw the feedback on the page such as a user message or button etc. its an interesting idea though with the JQuery.active line.
I use C# with webdriver and my approach for testing if an ajax call has finished is to run a delegate repeatedly until it returns an expected boolean result using Func<T> and a lambda expression to inline the function call.
If you dont know about delegates already I strongly advise that you do as they are really useful in test automation with webdriver.