Telerik Forums
Testing Framework Forum
1 answer
101 views
I created the little helper function below to confirm that a SL4 datagrid loads.  Im getting inconsistent results attempting to run this function on the same grid.  Basically sometimes it works sometimes not.  Is there issues in the framework around this?  Also if i actual break in vs2010 after the 'g' variable is set, and then try to put "?g" into the immediate window IE8 bombs.

Any thoughts?


        public static void VerifyGridLoaded(SilverlightApp app, string gridName)
        {

            DataGrid g = app.FindName<DataGrid>(gridName);
            g.Refresh();
            Assert.IsTrue(g.Rows.Count() > 0, gridName + " is empty.");
        }

Missing User
 answered on 12 May 2010
2 answers
166 views
Could you provide an updated link to - http://www.artoftest.com/Downloads/Support/vs_piaredist.exe

Thx.
Rob Lange
Top achievements
Rank 1
 answered on 07 May 2010
7 answers
406 views

Hello!
I am new in WebAii and, to be honest, I am new in C# programming.


I try creating my own project or using a sampler (SilverlightHealthcareSample.cs). I have an error with message:

 

Test method QuickStarts_VSTS_CS.SilverlightHealthcareSample.HealthCareDemo threw exception:  System.NullReferenceException: Object reference not set to an instance of an object..

 

at ArtOfTest.Common.TreeCrawler`3.SearchUsingNonHierarchialMatch(ITargetElement startNode, IList`1 clauses, V expression, Boolean ignoreConstraints)

at ArtOfTest.Common.TreeCrawler`3.Find(T startNode, IList`1 clauses, V expression, Boolean includeRoot, Boolean ignoreContraints)

at ArtOfTest.Common.TreeCrawler`3.ByExpression(T startNode, V expression, Boolean includeRoot)

at ArtOfTest.Common.TreeCrawler`3.ByExpression(V expression)

at ArtOfTest.WebAii.Silverlight.VisualFind.ByName(String name)

at ArtOfTest.WebAii.Silverlight.SilverlightApp.FindName(String name)

at QuickStarts_VSTS_CS.SilverlightHealthcareSample.HealthCareDemo() in C:\..\UnitTest1.cs:line 155

 

Error is occurred when I try to use any Find method.

 

My code (only interesting lines, actually it is all from the sampler):

 

[TestInitialize()]

public void MyTestInitialize()

{

Settings settings = GetSettings();

settings.EnableSilverlight = true;

Initialize(settings, new TestContextWriteLine(this.TestContext.WriteLine));

SetTestMethod(this, (string)TestContext.Properties["TestName"]);

}

 

[TestMethod]

[Description("Automate a complex Silverlight application")]

public void HealthCareDemo()

{

Manager.Settings.ExecutionDelay = 10;

Manager.LaunchNewBrowser(BrowserType.InternetExplorer);

System.Drawing.Point loc = ActiveBrowser.Window.Location;

ActiveBrowser.NavigateTo("http://www.mscui.net/PatientJourneyDemonstrator/PrimaryCareAdmin.htm");

ActiveBrowser.Window.Move(new System.Drawing.Rectangle(loc, new System.Drawing.Size(1024, 768)), true);

 

//SilverlightApp app = ActiveBrowser.SilverlightApps()[0];

// I have an error on the line above, but with line below works fine

SilverlightApp app = ActiveBrowser.SilverlightApps().First();

 

app.FindName("guideButton").User.Click(); // <= I have the error there

}

 

Also I tried to use construction like this:

            TextBox name1 = app.Find.ByName<TextBox>("name1");

            FrameworkElement ss = app.Find.ByName("name1");


I have the same error.

 

I tried to run that code with the latest version of WebAii 2.0 from ArtOfTest site. After that I uninstalled WebAii and installed WebAii (Testing Framework 2010.1.412.FREE_EDITION) from Telerik site. But the error is still present.

 

Could you please give me an advice to solve the issue? May be something wrong with my environment?

 

MS Win XP Professional SP 3 English

Visual Studio 2008

IE 8.0.6001.18702

MS Silverlight 3.0.50106.0 (add-ons is enabled in IE)

WebAii Test Execution Extension 2.0.50727.3053 (add-ons is enabled in IE)

Thanks for your attention.

Cody
Telerik team
 answered on 07 May 2010
1 answer
131 views
Can we perform performance testing with this framework?
Cody
Telerik team
 answered on 29 Apr 2010
1 answer
120 views

In one of the threads before I read that we can't have two manager objects as I noticed when getting all pipe busy message. What is the suggested way in creating X number of browser sessions and navigating them indipendently?

This didn't work for me:

 

 

Manager.LaunchNewBrowser(BrowserType.InternetExplorer, true);
Manager.LaunchNewBrowser(BrowserType.InternetExplorer, true); 

 

 

...
...
int numberOfBrowsers = Manager.Browsers.Count; //shows correct number of browser sessions
Manager.Browsers[0].Window.Show();
Manager.Browsers[0].Window.SetActive();

//how to find an element in silverlight page that is on the list
Pages.PageName.MyButton.Click(false);
Manager.ActiveBrowser.Window.Minimize();

Manager.Browsers[1].Window.Show();
Manager.Browsers[1].Window.SetActive();
Pages.PageName.MyButton.Click(false); //problem with this - it can't find this element to click on

...
...

Any Ideas? Thanks.

Cody
Telerik team
 answered on 29 Apr 2010
5 answers
117 views
I have a VS unit test that needs to alter the value of Settings.ExecuteCommandTimeout before doing a Get<>. I'm updating the Settings via the following code:

ActiveBrowser.Manager.Settings.ExecuteCommandTimeout = 8888;

When I initially created the Manager object I used a Settings object that set the ExecuteCommandTimeout property to 4444. So 4444 is the background setting and my override is 8888.

For testing's sake I'm using the following code in my unit test to verify that my Setting.ExecuteCommandTimeout is not being used:

resultControl = Get<HtmlControl>(new HtmlFindExpression("TextContent=" + textContent), false, 1000);
// check value of resultControl.Wait.Timeout in debugger
resultControl.Wait.ForExists(); // this line takes ~4444ms

If just before this code I check in the debugger the following:

ActiveBrowser.Manager.Settings.ExecuteCommandTimeout
ActiveBrowser.Frames[<all>].Manager.Settings.ExecuteCommandTimeout

where <all> are all the frames in my Frames collection, I see that the ExecuteCommandTimeout is 8888!

So my question is what am I missing to get the Get<> methods to honour the new timeout value?

Thanks in advance,
Matt


macon
Top achievements
Rank 1
 answered on 29 Apr 2010
2 answers
170 views
Hello All,

I'm new to WebAii framework and I've got a question about the Wait class.

I have a scenario where I need to locate a table cell (td). I'm going to locate it by content but the content might be contained directly inside the cell or it might be the content of a child element of the table cell (e.g. a span).

I'm using:
Get<WebAiiHtmlControls.HtmlTableCell>("TextContent=" + textContent, "tagname=td");

The problem is that it times out and raises a System.TimeoutException (because in this instance the text is contained deeper inside a span). In this scenario I just want it to timeout and the Get() method to return null. Is this possible? I don't really want to insert try/catch into my code.

Thanks,
Matt
macon
Top achievements
Rank 1
 answered on 27 Apr 2010
4 answers
165 views
I have been trying to get the WebAii Rad AJAX Control Wrapper to work for RadListView with limited success.  About to give up in frustration, I decided to run the sample application, the test for RadListView in the sample application failed on all test cases.

I am using Telerik WebAii Testing Framework 2010.1 (Version 101.4.12.0) and Telerik RadControls for ASP.NET AJAX Q1 2010 (10.1.3.9).

When my RadToolbar before the RadListView is visible, my finds seem to always fail.

        <telerik:RadAjaxPanel ID="AjaxPanel" 
                              runat="server" 
                              LoadingPanelID="AjaxLoadingPanel" 
                              ClientEvents-OnResponseEnd="ajaxResponseEnd" 
                              ClientEvents-OnRequestStart="ajaxRequestStart"
            <telerik:RadToolBar ID="SuperUser" 
                                runat="server" 
                                Width="100%" 
                                Visible="false"
                <Items> 
                    <telerik:RadToolBarDropDown Text="Information" 
                                                ID="InformationButton" 
                                                runat="server" 
                                                Visible="false"
                        <Buttons> 
                            <telerik:RadToolBarButton runat="server" 
                                                      ID="GpDatabase" 
                                                      Enabled="false" /> 
                                                       
                            <telerik:RadToolBarButton runat="server" 
                                                      ID="GpCompanyId" 
                                                      Enabled="false" /> 
                                                       
                            <telerik:RadToolBarButton runat="server" 
                                                      ID="TransFirstMode" 
                                                      Enabled="false" /> 
                                                       
                            <telerik:RadToolBarButton runat="server" 
                                                      ID="DatabaseServer" 
                                                      Enabled="false" /> 
                        </Buttons> 
                    </telerik:RadToolBarDropDown> 
                     
                    <telerik:RadToolBarButton ID="SalesRep" 
                                              runat="server" 
                                              Visible="false"
                        <ItemTemplate><img src="~/img/user_go.png" runat="server" style="vertical-align: middle;" /> Select Sales Rep: </ItemTemplate> 
                    </telerik:RadToolBarButton> 
                                                 
                    <telerik:RadToolBarButton ID="OriginalOwner" 
                                              runat="server" 
                                              Group="SalesReps" 
                                              CheckOnClick="true" 
                                              Checked="true" 
                                              ImageUrl="~/img/user_gray.png" 
                                              Visible="false" /> 
                     
                    <telerik:RadToolBarButton ID="CurrentRep" 
                                              runat="server" 
                                              Group="SalesReps" 
                                              CheckOnClick="true" 
                                              ImageUrl="~/img/user_edit.png" 
                                              Visible="false" /> 
                </Items> 
            </telerik:RadToolBar> 
            <telerik:RadListView ID="Projects" 
                                 runat="server" 
                                 ItemPlaceHolderID="ProjectHolder" 
                                 AllowPaging="true" 
                                 AllowCustomPaging="true" 
                                 PageSize="6"
                <LayoutTemplate> 
                    <div  class="RadListView RadListViewFloated RadListView_<%# Container.Skin %>"
                    <table style="margin: auto;" class="layout" cellspacing="0"
                        <tr> 
                            <td rowspan="5" style="background-repeat: repeat-y; background-image: url(img/border-left.png); background-position: right; width: 25px; padding: 0px;">&nbsp;</td> 
                            <td colspan="2"
                                <img src="img/ae_checkout.png" alt="Account Executive Checkout Logo" /> 
                            </td> 
                            <td rowspan="5" style="background-repeat: repeat-y; background-image: url(img/border-right.png); background-position: right; width: 25px; padding: 0px;">&nbsp;</td> 
                        </tr> 
                        <tr>                             
                            <td colspan="2"
                                <co:Navigator ID="QuickNavigator" runat="server" /> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="vertical-align: text-top;"
                                <asp:PlaceHolder ID="ProjectHolder" runat="server" /> 
                            </td> 
                            <td style="vertical-align: text-top; white-space: nowrap;"
                                <telerik:RadPanelBar ID="SalesItems" 
                                                     runat="server" 
                                                     Width="370px" 
                                                      
                                                     CssClass="invoice"
                                    <Items> 
                                        <telerik:RadPanelItem Text="Sales Items"
                                            <ItemTemplate> 
                                                <table cellpadding="0" cellspacing="0" style="width: 100%"
                                                    <tr> 
                                                        <td> 
                                                            <co:Invoice ID="SalesInvoice" runat="server" AllowRemoval="true" /> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="background-color: #8EA3B9; padding-left: 5px;"
                                                            <telerik:RadNumericTextBox ID="Discount" 
                                                                                       runat="server" 
                                                                                       Type="Currency" 
                                                                                       Label="Discount: " 
                                                                                       Value="0" 
                                                                                       EnabledStyle-HorizontalAlign="Right" 
                                                                                        /> 
                                                            <asp:ImageButton ID="ApplyDiscountButton" 
                                                                             runat="server" 
                                                                             ImageUrl="~/img/arrow_refresh.png" 
                                                                             OnClick="ApplyDiscountButton_Click" /> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="text-align: right; background-color: #8EA3B9;"
                                                            <asp:Button ID="ClearButton" runat="server" Text="Clear" OnClick="ClearButton_Click"/> 
                                                            <asp:Button ID="EstimateButton" runat="server" Text="Create Quote" OnClick="CreateEstimateButton_Click" /> 
                                                            <asp:Button ID="BillMeButton" runat="server" Text="Bill Me" OnClick="BillMeButton_Click" /> 
                                                            <asp:Button ID="CheckOutButton" runat="server" Text="Pay Now" OnClick="CheckOutButton_Click" />                                                             
                                                        </td> 
                                                    </tr> 
                                                </table> 
                                            </ItemTemplate> 
                                        </telerik:RadPanelItem> 
                                    </Items> 
                                </telerik:RadPanelBar> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td style="vertical-align: text-top" colspan="2"
                                <telerik:RadDataPager ID="DataPager" 
                                                      runat="server" 
                                                      PageSize="6" 
                                                      PagedControlID="Projects"
                                    <Fields> 
                                        <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> 
                                        <telerik:RadDataPagerButtonField FieldType="Numeric" /> 
                                        <telerik:RadDataPagerButtonField FieldType="NextLast" /> 
                                        <telerik:RadDataPagerPageSizeField PageSizeText="Projects per Page: " /> 
                                        <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go" /> 
                                        <telerik:RadDataPagerTemplatePageField> 
                                        <PagerTemplate> 
                                            <div style="float: right"
                                                <b>Projects 
                                                    <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1%>" /> 
                                                    to 
                                                    <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# IIf(Container.Owner.StartRowIndex+Container.Owner.PageSize > Container.Owner.TotalRowCount, Container.Owner.TotalRowCount, Container.Owner.StartRowIndex+Container.Owner.PageSize) %>" /> 
                                                    of 
                                                    <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount %>" /> 
                                                    <br /> 
                                                </b> 
                                            </div> 
                                        </PagerTemplate> 
                                    </telerik:RadDataPagerTemplatePageField> 
                                    </Fields> 
                                </telerik:RadDataPager>                                 
                            </td> 
                        </tr> 
                    </table>        
                    </div>  
                </LayoutTemplate> 
                <ItemTemplate> 
                    <asp:HiddenField ID="ProjectName" runat="server" Value='<%#Eval("ProjectAbbreviation") %>' /> 
                    <telerik:RadPanelBar ID="ProjectPanelBar" 
                                         runat="server" 
                                         Width="619px" 
                                         CssClass='<%#IIf(Eval("ProjectAbbreviation").ToString().Equals(Account.DefaultProject, StringComparison.CurrentCultureIgnoreCase), "highlightedProject projectHolder", "projectHolder") %>'
                        <Items> 
                            <telerik:RadPanelItem Text="Project Name" 
                                                  runat="server" 
                                                  ClickedCssClass="rpOut" 
                                                  ExpandedCssClass="rpOut" 
                                                  FocusedCssClass="rpOut" 
                                                  SelectedCssClass="rpOut"
                                <ItemTemplate>      
                                    <co:Project ID="Project" runat="server" />                     
                                </ItemTemplate> 
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelBar> 
                     
                </ItemTemplate>                             
                <EmptyDataTemplate> 
                    <span style="width: 619px; text-align: center;"
                        <h1>No projects available for this account.</h1> 
                    </span> 
                </EmptyDataTemplate>                 
            </telerik:RadListView> 
        </telerik:RadAjaxPanel>   

Test Framework Code:
        Dim ajaxPanelPanel As HtmlDiv = Find.ById(Of HtmlDiv)("AjaxPanelPanel"
 
        Assert.IsNotNull(ajaxPanelPanel) 
 
        Dim ajaxPanel As HtmlDiv = Find.ById(Of HtmlDiv)("AjaxPanel"
 
        Assert.IsNotNull(ajaxPanel) 
 
        'Dim element_ As ArtOfTest.WebAii.ObjectModel.Element = ajaxPanel.Find.ById("Projects") 
        'Dim listView As RadListView = element_.As(Of RadListView)() 
        Dim listView As RadListView = ajaxPanel.Find.ByAttributes(Of RadListView)("class=RadListView RadListViewFloated RadListView_Default"

I can find the div and use an As(Of RadListView)(), but it throws an exception about the span should of been an input.  I recently upgraded to the latest version (above) to see if it would resolve some of these issues but no luck.
Konstantin Petkov
Telerik team
 answered on 27 Apr 2010
3 answers
393 views

Hi,

I am reposting this thread because it fails to open when I click on it, even though other threads open fine:


I am getting the following exception thrown:

ExecuteCommand failed!
InError set by the client. Client Error:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at mshtml.HTMLWindow2Class.IHTMLWindow2_get_location()
   at ArtOfTest.InternetExplorer.IECommandProcessor.SetCurrentDocumentMarkup(BrowserCommand& response)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessInformationCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Information',Info:'DocumentMarkup',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_5b9018b6-a3c7-4783-b359-b959491b385e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at mshtml.HTMLWindow2Class.IHTMLWindow2_get_location()
   at ArtOfTest.InternetExplorer.IECommandProcessor.SetCurrentDocumentMarkup(BrowserCommand& response)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessInformationCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.


Some other details from the command:
ActionType: ArtOfTest.WebAii.Messaging.Process.BrowserActionType.NotSet
CommandType: ArtOfTest.WebAii.Messaging.Process.BrowserCommandType.Information



The call stack when the exception is thrown shows that the framework is making 2 native code transitions, potentially the source of the memory corruption...?

ArtOfTest.WebAii.dll!ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(ArtOfTest.WebAii.Messaging.Process.BrowserCommand request = {BrowserCommand (Type:'Information',Info:'DocumentMarkup',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_5b9018b6-a3c7-4783-b359-b959491b385e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')}) + 0x352 bytes
  ArtOfTest.WebAii.dll!ArtOfTest.WebAii.Core.Browser.ExecuteCommand(ArtOfTest.WebAii.Messaging.Process.BrowserCommand request = {BrowserCommand (Type:'Information',Info:'DocumentMarkup',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_5b9018b6-a3c7-4783-b359-b959491b385e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')}, bool performDomRefresh = false, bool waitUntilReady = false) + 0x42 bytes
  ArtOfTest.WebAii.dll!ArtOfTest.WebAii.Core.Browser.RefreshDomTree() + 0x113 bytes
  ArtOfTest.WebAii.dll!ArtOfTest.WebAii.ObjectModel.Element.Refresh(bool forceDomTreeRefresh = true) + 0x33 bytes
  [Native to Managed Transition]
  [Managed to Native Transition]
  ArtOfTest.Common.dll!ArtOfTest.Common.WaitAsync.CallRefreshIfNeeded<ArtOfTest.WebAii.ObjectModel.Element>(ArtOfTest.WebAii.ObjectModel.Element target = {[Element: 'div:221' (id=ctl00_ctl00_Fcph_Mcph_portalBody_portalTabStrip)]}) + 0x261 bytes
  ArtOfTest.Common.dll!ArtOfTest.Common.WaitAsync._worker_DoWork<ArtOfTest.WebAii.ObjectModel.Element,object>(object waitParam = {ArtOfTest.Common.WaitAsync.WaitParams<ArtOfTest.WebAii.ObjectModel.Element,object>}) + 0x228 bytes
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(object state) + 0x2f bytes
  mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x51 bytes
  [Native to Managed Transition]
  [Managed to Native Transition]
  mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x67 bytes
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x45 bytes
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback tpWaitCallBack) + 0x53 bytes
  mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(object state) + 0x59 bytes
  [Appdomain Transition]


Not sure what I can do about this?

Cheers,
Scott


Cody
Telerik team
 answered on 26 Apr 2010
1 answer
203 views
Hi guys!

I've got a problem with Browser.WaitUntilReady method with IE. It ends by time out very often (but not always). When I look on browser during test process it seems that IE window doesn't do anything.

What conditions does WaitUntilReady method depend on? What logic is behind it?

I'm using WebAii 1.1, IE 7, Windows XP Professional.


Thanks for your help!
Missing User
 answered on 23 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?