This is a migrated thread and some comments may be shown as answers.

INvalidOperationException bei browser.LaunchNewBrowser()

11 Answers 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Silvio
Top achievements
Rank 1
Silvio asked on 28 Jun 2013, 10:35 AM
Hi,

in the last days the framework couldn't manage to open a browser and navigate to any site. Like nearly every of my problems in the last time this occured although I hadn't modified any of the code.
It isn't always the same Exception, but always gets thrown at LaunchNewBrowser.

This is today's Exception:

System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect)
   at ActaNova.TWebTest.Core.Utilities.ApplicationUtility.GetManager(String url, HtmlFindExpression waitForElementExistsFindEx) in c:\Development\AN\webaii\WebTest\TWebTest.Core\Utilities\ApplicationUtility.cs:line 632


And this is the other:

System.ApplicationException: Exception thrown attempting to launch Internet Explorer. Please make sure Internet Explorer is properly installed and you are able to launch it. ---> System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Int32 timeout)
   at ArtOfTest.Common.Win32.Connector.Attach(IntPtr& handle, Boolean findTabWindow)
   at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect)
   at ActaNova.TWebTest.Core.Utilities.ApplicationUtility.GetManager(String url, HtmlFindExpression waitForElementExistsFindEx) in c:\Development\AN\webaii\WebTest\TWebTest.Core\Utilities\ApplicationUtility.cs:line 632


I give it 10 tries and one second timeout between, but from time to time it doesn't work anyway.
What can be the reason for this and what could be the reason for all these problems occuring over night?

Thanks in advance!

11 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 01 Jul 2013, 08:42 AM
Hi Silvio,

I am sorry you are experiencing this issue.

Could you please check this article in order to overcome this issue. Please reset Internet explorer settings and then configure it again.


Usually this issue is caused by an add-on in the IE browser, so I recommend you to disable all the installed add-ons and give it a try.

Let me know if this helps. 

Regards,
Boyan Boev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Silvio
Top achievements
Rank 1
answered on 01 Jul 2013, 11:04 AM
Hi Boyan,

Thanks for your help!

It seems like the problem solved itself the same way it occured. Today I couldn't reproduce it until now. If it comes up again I'll try your advise. But I don't beleive this would help as I didn't make any changes to the IE settings and also didn't install any add-ons.

Kind Regards
0
Boyan Boev
Telerik team
answered on 01 Jul 2013, 11:56 AM
Hi Silvio,

Glad to hear it! Thank you for the update.

Should you have any additional questions please do not hesitate to ask us.

Regards,
Boyan Boev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Silvio
Top achievements
Rank 1
answered on 05 Jul 2013, 01:20 PM
Hi Boyan,

the problem came up again. I'm running tests on my local machine with IE9 and on a new VM with IE8.
In time it doesn't work with IE8 (but it did some hours ago and the last days) and sometimes also doesn't work with IE9 (but then just fails about three times).
I have already reset IE (on the VM) and configured it again but still got an InvalidOperationException. Then I reinstalled the framework and it worked... One time. Now it doesn't work again and I don't know what to do.
The other tipps from the article won't help. Everything is configured, installed, reinstalled and runs in x86 mode and there are no add-ons installed except of default ones.

Kind Regards
0
Silvio
Top achievements
Rank 1
answered on 09 Jul 2013, 10:09 AM
Hi,

we managed to solve the problem. We had always waitForBrowserToConnect set to false when calling LaunchNewBrowser. This always worked, but stopped working over night.
I always thought that this would wait for the start site to be loaded. But what is this parameter for? You always have to wait for the browser to be ready and in the browsers collection anyway, don't you? If so, it would be like having a shouldWork parameter. What is it's real purpose?

Kind Regards
0
Velin Koychev
Telerik team
answered on 10 Jul 2013, 12:22 AM
Hi Silvio,

It is great to hear that you've been able to solve this issue by your own.

The reason we have this parameter, waitForBrowserToConnect, is to tell Test Studio whether to wait for the browser to return to a "ready" state or not. 
Sometimes it is posible that the browser will not send "ready" state, although it should.

I agree with you that this name might be very misleading.


Regards,
Velin Koychev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Silvio
Top achievements
Rank 1
answered on 10 Jul 2013, 07:49 AM
Hi Velin,

thanks for your answer!
So setting ths parameter to true might also lead to problems?

Kind Regards
Silvio
0
Velin Koychev
Telerik team
answered on 15 Jul 2013, 07:44 AM
Hi Silvio,

Yes, it is possible that you might experience  issues even if you set waitForBrowserToConnect to True. However this is also very unlikely to happen, but it is good to be known as a potential problem.

Regards,
Velin Koychev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Silvio
Top achievements
Rank 1
answered on 15 Jul 2013, 07:46 AM
Hi,

Ok, thanks for your answer!

Kind Regards
0
Kiran
Top achievements
Rank 1
answered on 25 Jul 2013, 08:12 AM
Hi I was facing a similar issue and all the solutions discussed in the forum did not help me out:
We are using ArtOfTest(WebAii) framework. All the testers were working fine and suddenly started failing from past few days with the following error.
Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.WebAii.Core.Manager.WaitForBrowserToConnect(Int32 browserIndexToWaitFor)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle)

Solution:
 
The reason for this error was because of some settings which was globally made on all our machines without our knowledge.
Allow third-party browser extensions setting in IE should be enabled.
This setting can be found For IE8 at : IE->Tools->Internet Options->Under 'Advanced Tab'->Under Heading 'Browsing'.

This setting can be added if found valid for everyone @ Configure the Browser 

Thanks,
Kiran K N.
0
Velin Koychev
Telerik team
answered on 26 Jul 2013, 11:52 AM
Hello Kiran,

Thank you for sharing with us this solution.

We will investigate further what issues this IE setting could bring.

We appreciate your feedback!

Regards,
Velin Koychev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Silvio
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Silvio
Top achievements
Rank 1
Velin Koychev
Telerik team
Kiran
Top achievements
Rank 1
Share this question
or