INvalidOperationException bei browser.LaunchNewBrowser()

12 posts, 0 answers
  1. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 28 Jun 2013 Link to this post

    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!
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 01 Jul 2013 Link to this post

    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
  3. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 01 Jul 2013 Link to this post

    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
  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 01 Jul 2013 Link to this post

    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
  5. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 05 Jul 2013 Link to this post

    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
  6. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 09 Jul 2013 Link to this post

    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
  7. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 09 Jul 2013 Link to this post

    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
  8. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 10 Jul 2013 Link to this post

    Hi Velin,

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

    Kind Regards
    Silvio
  9. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 15 Jul 2013 Link to this post

    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
  10. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 15 Jul 2013 Link to this post

    Hi,

    Ok, thanks for your answer!

    Kind Regards
  11. Kiran
    Kiran avatar
    12 posts
    Member since:
    Nov 2010

    Posted 25 Jul 2013 Link to this post

    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.
  12. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 26 Jul 2013 Link to this post

    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
Back to Top