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

System.InvalidOperationException: Sequence contains no elements

1 Answer 158 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aruna
Top achievements
Rank 1
Aruna asked on 09 Nov 2011, 06:46 PM
trying something of this form

Manager.LaunchNewBrowser(

 

BrowserType.FireFox,false);

 

ActiveBrowser.NavigateTo(

 

"http://www.google.com");

 


Am I missing anything

throws 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, ProcessWindowStyle windowStyle)
   at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect)
   at WebTests.NavTest1.TestMethod1() in D:\NAVSrc\Main\CMA.VM\WebTests\NavTest1.cs:line 96

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 10 Nov 2011, 04:02 PM
Hi Aruna,

You are getting this error because of this line:
Manager.LaunchNewBrowser(BrowserType.FireFox, false);
When the second argument of the LaunchNewBrowser() method is set to "false" the framework will not wait for the new browser to connect. In order to make this to work, you need to change it to "true" or to delete the bool argument completely.

If you haven't done so already, please check out our online documentation here. If you have any further questions, please don't hesitate to ask! 

Regards,
Plamen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Aruna
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or