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

Unabale to launch browser with code

4 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ravi
Top achievements
Rank 1
ravi asked on 03 Sep 2010, 12:55 PM

I am trying to launch browser using below code, I wan to use same Manager for all my scripts. when run the below code a blanck browser is opened and after few seconds, sytem throws error at line 2 saying that "wait for conditation has timed out " 

error discription error stack is

[System.TimeoutException] {"Wait for condition has timed out"} System.TimeoutException

below is my code snippet


public

 

static Boolean StartBrowser(){

 

 

try

 

{

 

 

Global.ObjManager = new Manager(false);

 

 

 

Global.ObjManager.LaunchNewBrowser(BrowserType.InternetExplorer, true);

 

 

 

 

//Manager.LaunchNewBrowser();

 

 

Global.ObjManager.ActiveBrowser.NavigateTo(Global.strUrl);

 

 

// Set the short-cuts to the main automation objects.

 

 

Global.ObjBrowser = Global.ObjManager.ActiveBrowser;

 

 

Global.ObjFind = Global.ObjBrowser.Find;

 

 

 

return true;

 

}

 

catch (System.Exception excep)

 

{

 

Console.Write(excep.Message);

 

}

 

return true;

 

}

4 Answers, 1 is accepted

Sort by
0
Accepted
Nikolai
Telerik team
answered on 03 Sep 2010, 01:35 PM
Hello ravi,

From the information you sent I don't see where you call the Manager.Start() method. If you have not called the Start method please do so before calling the LaunchNewBrowser(),  also it is better to create the Manager instance with default configuration this way the TimeOuts and other values will be automatically set:

var manager = new Manager(new Settings());



All the best,
Nikolai
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
0
ravi
Top achievements
Rank 1
answered on 03 Sep 2010, 01:47 PM
Hi Nikolai,

Thanks for the quick reply. It is working now after adding Manager.start() method.

Regards

Ravi
0
Chad
Top achievements
Rank 1
answered on 24 Sep 2010, 12:26 AM
I am having the exact same problem, a TimeoutException on Manager.LaunchNewBrowser(BrowserType.InternetExplorer).  However, in my case, doing a Manager.Start() after constructing a Manager object does not fix it.

Code:

        [TestMethod]
        public void TelerikSilverlightPOC()
        {
            Manager man = new Manager(new ArtOfTest.WebAii.Core.Settings());
            man.Start();

            man.Settings.ExecutionDelay = 10;

            man.LaunchNewBrowser(BrowserType.InternetExplorer);
        }

0
Nikolai
Telerik team
answered on 24 Sep 2010, 05:15 AM
Hello Chad,

Can you please review this article on how to configure your IE browser. 
In case your OS is Windows Server 2003/2008 you will need additional configuration you can find here.
Also please make sure you are using account that has Administrative privileges on your machine. 

Best wishes,
Nikolai
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
ravi
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
ravi
Top achievements
Rank 1
Chad
Top achievements
Rank 1
Share this question
or