var settings = new Settings { EnableSilverlight = true, ExecutionDelay = 50, EnableUILessRequestViewing = false, QueryEventLogErrorsOnExit = false, EnableScriptLogging = false, AnnotateExecution = true, AnnotationMode = AnnotationMode.All, RecycleBrowser = true, DefaultBrowser = BrowserType.InternetExplorer, };
ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!
InError set by the client. Client Error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x000003E9): System.TypeInitializationException: The type initializer for 'ArtOfTest.WebAii.Silverlight.ObjectSerializer' threw an exception. ---> System.InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.
at System.RuntimeType.get_GenericParameterPosition()
--- End of inner exception stack trace ---
at System.Windows.Browser.ManagedObjectInfo.Invoke(ManagedObject obj, InvokeType invokeType, String memberName, ScriptParam[] args)
at System.Windows.Hosting.ManagedHost.InvokeScriptableMember(IntPtr pHandle, Int32 nMemberID, Int32 nInvokeType, Int32 nArgCount, ScriptParam[] pArgs, ScriptParam& pResult, ExceptionInfo& pExcepInfo)
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at ArtOfTest.InternetExplorer.JsObjectWrapper.Call(String methodName, Object[] args)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Silverlight',Info:'NotSet',Action:'NotSet',Target:'ElementId (tagName: 'object',occurrenceIndex: '0')',Data:'{"Method":null,"Property":null,"Reference":null,"Reference2":null,"Type":10,"Value":"FrameworkElement;CheckBox;ChildWindow;ComboBox;DataGridCell;DataGridRow;DataGrid;RadioButton;RepeatButton;DataGridCellsPresenter;DataGridColumnHeader;DataGridColumnHeadersPresenter;DataGridDetailsPresenter;DataGridFrozenGrid;DataGridRowHeader;DataGridRowsPresenter;Calendar;CalendarButton;CalendarDayButton;CalendarItem;DatePicker;DatePickerTextBox;GridSplitter;PreviewControl;TabControl;TabItem;TabPanel;Shape;Path;Ellipse;Line;Polygon;Polyline;Rectangle;Glyphs;Panel;Image;Canvas;TextBlock;MediaElement;InkPresenter;MultiScaleImage;StackPanel;Control;TextBox;PasswordBox;Grid;ItemsControl;Border;ContentControl;ContentPresenter;ItemsPresenter;Popup;UserControl;ButtonBase;Button;ToggleButton;Selector;HyperlinkButton;ListBox;RangeBase;ScrollBar;Thumb;ScrollContentPresenter;ScrollViewer;Slider;ToolTip;ProgressBar;ListBoxItem;ComboBoxItem;VirtualizingStackPanel;"}',ClientId:'Client_d284ca17-4bc1-4219-a0e9-56a2af98f06b',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x000003E9): System.TypeInitializationException: The type initializer for 'ArtOfTest.WebAii.Silverlight.ObjectSerializer' threw an exception. ---> System.InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.
at System.RuntimeType.get_GenericParameterPosition()
--- End of inner exception stack trace ---
at System.Windows.Browser.ManagedObjectInfo.Invoke(ManagedObject obj, InvokeType invokeType, String memberName, ScriptParam[] args)
at System.Windows.Hosting.ManagedHost.InvokeScriptableMember(IntPtr pHandle, Int32 nMemberID, Int32 nInvokeType, Int32 nArgCount, ScriptParam[] pArgs, ScriptParam& pResult, ExceptionInfo& pExcepInfo)
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at ArtOfTest.InternetExplorer.JsObjectWrapper.Call(String methodName, Object[] args)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Silverlight.SilverlightProxy.ExecuteSLCommand(SilverlightCommand cmd)
at ArtOfTest.WebAii.Silverlight.SilverlightProxy.PublishKnownControlTypes(List`1 knownTypes)
at ArtOfTest.WebAii.Silverlight.SilverlightApp.Connect(Int32 timeout)
at ArtOfTest.WebAii.Silverlight.SilverlightApp.Connect()
at ArtOfTest.WebAii.Silverlight.SilverlightAppsList.get_Item(Int32 index)
Helpers\TestHelper.cs(15,0): at Insurer.Analytics.Acceptance.Test.Helpers.TestHelper.get_SilverlightApp()
SetUp : 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 outat 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)at WebAiiTestClass.TestBase.TestBaseSetUp() in TestBase.cs: line 21--TimeoutExceptionat ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)at ArtOfTest.Common.WaitSync.For(Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)at ArtOfTest.Common.WaitSync.For(Predicate`1 predicate, T target, Int32 timeout)at ArtOfTest.Common.Win32.WindowManager.Attach(ref IntPtr handle, Boolean findTabWindow, Boolean loadClr, ref IntPtr hookId)at ArtOfTest.WebAii.BrowserSpecialized.InternetExplorer.InternetExplorerActions.LaunchNewBrowserInstance(Int32 timeout, ProcessWindowStyle windowStyle, String pipename)I have all the settings set according to:
http://www.artoftest.com/support/webaii/topicsindex.aspx?topic=configureie6
But still no help.
Unfortunately upgrading to IE7+ is not an option. Please any help would be greatly appreciated.
Also just incase it helps:
namespace WebAiiTestClass{ [TestFixture] public abstract class TestBase : BaseTest { protected internal SilverlightApp App { get; private set; } [SetUp] public void TestBaseSetUp() { var settings = GetSettings(); settings.EnableSilverlight = true; settings.LogLocation = @"C:\Documents and Settings\alicross\My Documents\Dev\UI\Testing\WebAiiTestClass"; Initialize(settings, NUnit.Core.TestContext.Out.WriteLine); Manager.LaunchNewBrowser(BrowserType.InternetExplorer); ActiveBrowser.NavigateTo("http://localhost:4882/TestPage.aspx"); App = ActiveBrowser.SilverlightApps()[0]; } [TearDown] public void TestBaseTearDown() { CleanUp(); } [TestFixtureTearDown] public void TestBaseFixtureTearDown() { ShutDown(); } }}How can I use a variable in the code "searchLnk = ActiveBrowser.Find.ByContent(contentvalue);"
Where conentvalue was previously defined by contentvalue = “btnG”;
Rather than searchLnk = ActiveBrowser.Find.ByContent(”btnG”);
is there a way NOT to have to use a LITERAL value?
thanks joe
<a href="http://google.com">mega link</a>Settings settings = new Settings(BrowserType.InternetExplorer, "d:\\log\\");Manager manager = new Manager(settings);manager.Start();manager.LaunchNewBrowser();manager.ActiveBrowser.NavigateTo("http://aspspider.ws/kovyar/find_bycontent_test.htm");manager.ActiveBrowser.WaitUntilReady();Element element = manager.ActiveBrowser.Find.ByContent("mega link"); //null in both browsers, the desired way to find the elementElement element1 = manager.ActiveBrowser.Find.ByContent("mega link".Replace(' ', (char)160)); //null in IEElement element2 = manager.ActiveBrowser.Find.ByContent("mega link".Replace(" ", " ")); //null in FFAssert.IsNotNull(element1); //here fails IEAssert.IsNotNull(element2); //here fails FFmanager.Dispose();...<frameset rows="100%,0,0,0" onload="gotoUrl('/here_is_the_url',null)"> <frame frameborder="0" name="frame1" src="about:blank"> <html> <head>...</head> <body> <div id="divID">...</div> </body> </html> </frame> <frame scrolling="no" noresize="" frameborder="0" name="frame2" src="about:blank">...</frame> <frame scrolling="no" noresize="" frameborder="0" name="frame3" src="about:blank">...</frame> <frame scrolling="no" noresize="" frameborder="0" name="frame4" src="about:blank">...</frame> <noframes> <body bgcolor="#FFFFFF"> <p>your browser does not handle frames</p> </body> </noframes></frameset>...Browser frame = Manager.ActiveBrowser.Frames["frame1"];Element divEle = frame.Find.byId("divID");[Test]public void GoogleTest(){ Manager.LaunchNewBrowser(); ActiveBrowser.NavigateTo("http://www.google.com"); HtmlInputText queryBox = Find.ByName<HtmlInputText>("q"); Log.WriteLine(queryBox.IsActiveElement.ToString()); Desktop.Mouse.Click(MouseClickType.LeftClick, queryBox.GetRectangle()); Desktop.KeyBoard.TypeText("sample", 1000); Actions.Click(Find.ById("btnG"));}