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;
}
[Test]public void SimpleTest(){ Manager.LaunchNewBrowser(); ActiveBrowser.WaitUntilReady(); ActiveBrowser.Window.Maximize(); ActiveBrowser.NavigateTo(MyServerUrl); var headerItems = new HeaderItems(MySilverlightApp); headerItems.ReportsNavigationButton.User.Click();}
...[16:34] - Unable to load ArtOfTest.Connector.dll[16:34] - Exception Details:[16:34] - ------------------[16:34] - System.ArgumentNullException: Wartość nie może być zerowa.Nazwa parametru: ptr w System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t) w ArtOfTest.Common.Win32.WindowManager..cctor()System.NullReferenceException : Odwołanie do obiektu nie zostało ustawione na wystąpienie obiektu.w IFin24App.WebAii.ApplicationElements.HeaderItems.get_ReportsNavigationButton() w HeaderItems.cs: line 53
...[Test] public void GoogleTest() { ActiveBrowser.NavigateTo("http://www.google.com"); ActiveBrowser.WaitUntilReady(); HtmlInputText queryBox = Find.ByName<HtmlInputText>("q"); Desktop.Mouse.Click(MouseClickType.LeftClick, queryBox.GetRectangle()); Desktop.KeyBoard.TypeText("sample", 1000); Actions.Click(Find.ById("btnG")); }