Telerik Forums
Testing Framework Forum
8 answers
212 views
Hi,
We're migrating from WebAii 1.1 to WebAii 2.0 and found some problems.
One of them it's a problem with HtmlControl methods MouseHover() and MouseClick(). When we'are using these methods there is an error

System.NullReferenceException: Object reference not set to an instance of an object.
at ArtOfTest.WebAii.Core.Desktop.EnsureBrowserOnFocusIfPossible()
at ArtOfTest.WebAii.Win32.Mouse.HoverOver(Rectangle target)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.MouseHover()

But when we're using Desktop Mouse methods(see Appendix) everything is ok but this workaround is quite tricky for us.

Could you assist us with this issue?

Appendix:
            HtmlControl x = new HtmlControl(...);
            Desktop desk = new Desktop();
            desk.Mouse.HoverOver(x.GetRectangle());
Konstantin Petkov
Telerik team
 answered on 15 Jul 2010
2 answers
89 views
Hi there,

Is there an equivalent to ContainsText() in order to verify whether a button exists or not ? 
In the past I've been using an Xpath expression like //input[@value="Button caption name"]
and based on the return value which was true/false I could determine the existence of the button on the page. 

Ta, 
SD. 
SD
Top achievements
Rank 1
 answered on 14 Jul 2010
2 answers
104 views
Hi,

I have a page that contains a RadAjaxPanel, i am trying to write test code to validate the contents of a list that is async loaded in the ajaxPanel.

Here is the basic structure of my page and UserControls:

default.aspx
<telerik:RadAjaxPanel ID="ajaxPanel_Activities"
runat="server" EnableAJAX="true"
LoadingPanelID="loadingPanel_Activities"
RequestQueueSize="1">
     <div>
         <ahp:ActivitiesTabPanel runat="server" ID="activitiesTabPanel" />
     </div>
</telerik:RadAjaxPanel>

 
ahp.ahp:ActivitiesTabPanel UserControl
<div class="wideColumn">
    <telerik:RadMultiPage ID="radMultiPage_ActivitiesLists" runat="server" SelectedIndex="0">
       <telerik:RadPageView ID="radPageView_ActivitiesListLive" runat="server">
             <ahp:ActivitiesList ID="activitiesList_Live" runat="server"                   NumberOfResults="0" ReferenceActivityGroupName="Activities Page - Lives" OnMouseOver="showActivityContent('{0}', '{1}', '{2}');"         OnMouseOut="startTimer();"/>
        </telerik:RadPageView>
    </telerik:RadMultiPage>
<div>


ahp.ahp:ActivitiesList  UserControl

<asp:Repeater ID="rptActivities" runat="server" OnItemDataBound="rptActivities_ItemDataBound" >
    <ItemTemplate>
       <asp:LinkButton ID="linkTopic" runat="server" Text='<%# Eval("Topic") %>' CommandName="Click" CommandArgument='<%# Eval("ActivityId") %>' OnCommand="activityLink_Command" />
    </ItemTemplate>
</asp:Repeater>


So I am trying to find all the HtmlAnchors that are rendered by the ahp:ActivitiesList  UserControl.
But the linksInPanel Never contains the elements that are actually displayed.


Here is my test code

HtmlDiv ajaxPanel = _manager.ActiveBrowser.Find.ById<HtmlDiv>("ctl00_ctl00_cphContent_plcContent_ajaxPanel_Activities");
            Thread.Sleep(3000); //Give time for ajaxPanel to load.
 
            ReadOnlyCollection<HtmlAnchor> linksInPanel =ajaxPanel.Find.AllByTagName<HtmlAnchor>("a");
            HtmlAnchor match = null;
            foreach (HtmlAnchor ank in linksInPanel )
            {
                if (activities.ActivityTarget[0].Topic.ToLower().Trim() == ank.BaseElement.InnerText.ToLower().Trim())
                {
                    match = ank;
                    break;
                }
            }
            Assert.IsTrue(match != null);


Is this a limitation caused by the dynamically loaded markup in the ajaxPanel?
Or am i just not looking for my links in the right way?

Thanks for any help,
Daniel
delofer@aptilon.com
Daniel
Top achievements
Rank 1
 answered on 13 Jul 2010
2 answers
111 views
Hi
i am trying to display the gridview elements.i need to print these elements based on the textbox value.it is just like search functionality..
in this process i am getting this error message

Failure Information:
~~~~~~~~~~~~~~~
Unable to locate element. Details: Attempting to find [Silverlight] element using
Find logic
 (Html): [id 'Exact' silverlightControlHost] THEN UNDER NODE FIND [tagIndex 'Exact' object:0]
 (Silverlight): [TextContent 'Exact' LakTestAcc8] AND [XamlTag 'Exact' textblock]

Unable to locate element. Search failed!

--------------------------------------------------
'7/7/2010 5:22:03 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
--------------------------------------------------
'7/7/2010 5:22:05 AM' - Overall Result: Fail
--------------------------------------------------


this is silverlight page


Regards:
AnkammaRao.V
Missing User
 answered on 13 Jul 2010
1 answer
80 views
Hello!

I have a Canvas with Transformations applied(one of them is a RotateTransform). WebAii framework allows us to access to all transformations and its properties, unfortunately when I try to change a property, namly Angle in RotateTransform object, the change is not propagated to interface. Is framework working properly? Or I'm using it incorrectly?

Sample
...
ArtOfTest.WebAii.Silverlight.UI.Rectangle rotateRectangle = wk.Find.ByName<ArtOfTest.WebAii.Silverlight.UI.Rectangle>("RotateHandle");
 RotateTransform rotateTransform = (_canvas.RenderTransform as TransformGroup).Children.Single(x => x.GetType() == typeof(RotateTransform)) as RotateTransform;

//It starts with 0º degrees
rotateTransform.Angle+=50; //Nothing happen in interface, but if I change the rotation using interface, correct value is available.

Thanks in advance,

Carlos Marcão
Missing User
 answered on 08 Jul 2010
3 answers
352 views

Hi,

We're migrating from WebAii 1.1 to WebAii 2.0 and found some problems.
One of them it's a problem with Manager.ActiveBrowser Property.

When I'm using on of these methods:
            Manager.ActiveBrowser.WaitUntilReady();
            Manager.ActiveBrowser.RefreshDomTree();

I'm receiving an error:
System.NullReferenceException: Object reference not set to an instance of an object.
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'IsReady',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_e525dafc-eedf-434b-867a-ce3dadb58785',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.NullReferenceException: Object reference not set to an instance of an object.
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Core.Browser.IsReady()
at ArtOfTest.WebAii.Core.Browser.WaitUntilReady()

But when I'm using Manager.Browsers[0]  everything is ok, But unfortunately this workaround require us to do huge amount of work, because we have already created a lot of tests (3000+) which now work using WebAii 1.1

 

 Could you assist us with this issue?

Best regards,
Artem Nenashev

 

Cody
Telerik team
 answered on 07 Jul 2010
1 answer
130 views
Hi Guys,

I have the following button:
<input id="allocationConfirmationForm:confirmOK" type="button" value="OK"  
 
onclick="A4J.AJAX.Submit('allocationConfirmationForm:contentRegion','allocationConfirmationForm',event,{'parameters':{ 
 
'allocationConfirmationForm:confirmOK':'allocationConfirmationForm:confirmOK'}  
 
,'actionUrl':'/vtdWeb/spring/dashboard?execution=e1s2&javax.portlet.faces.DirectLink=true'} );return false;"  
 
name="allocationConfirmationForm:confirmOK"/> 

I have tried several approaches (While knowing that is an Ajax button) and it seems to be failing. 
When I tried:
  Element e = Manager.ActiveBrowser.Find.ByName("allocationConfirmationForm:confirmOK"); 
Manager.ActiveBrowser.Actions.Click(e); 

I got: 
The target Element object passed in for this action is null. Action aborted. Possible causes to this exception is the 
element not present in the page markup and the Find.Byxx returning null.
Parameter name: TargetElement

Have no issues with other buttons..(Inc Ajax buttons)What is wrong here ?
Ta, 
SD.

SD
Top achievements
Rank 1
 answered on 07 Jul 2010
2 answers
145 views
Hello Nelson,
How are u ? iam sending screeshot plez check it .
I am just exporing on the issue bec in future the whole poject have to
automate in telerik plez do u best the below is error it is showing
1)version iam using is vsts 2008


'6/25/2010 2:49:17 AM' - 'Fail' : 24. Click Item10Hyperlinkbutton
--------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Unable to locate element. Details: Attempting to find [Silverlight] element using
Find logic
 (Html): [id 'Exact' silverlightControlHost] THEN UNDER NODE FIND [tagIndex 'Exact' object:0]
 (Silverlight): [XamlTag 'Exact' gridviewvirtualizingpanel] AND [automationid 'Exact' PART_GridViewVirtualizingPanel] THEN UNDER NODE FIND [XamlPath 'Exact' /gridviewrow[6]/grid[name=grid]/datacellspresenter[name=PART_DataCellsPresenter]/stackpanel[0]/horizontalscrollpanel[name=PART_PartialScrollContainer]/gridviewcellspanel[name=PART_GridViewCellsPanel]/gridviewcell[1]/grid[name=SelectionBackground]/alignmentcontentpresenter[name=PART_ContentPresenter]/grid[0]/hyperlinkbutton[0]]

Unable to locate element. Search failed!

--------------------------------------------------
'6/25/2010 2:49:17 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
--------------------------------------------------
'6/25/2010 2:49:19 AM' - Overall Result: Fail


regards
Dileep.s

--------------------------------------------------



 
Missing User
 answered on 06 Jul 2010
2 answers
150 views
Hello Nelson,
I was wonder to see this exception because when i was running the scenerio it was well going after continuesly running the same
scenerio again and again the below exception is giving could you plez tell me why this exception is coming

System.ApplicationException: Unexpected error. SyncWaitResult was null for this wait
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo)
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait)
   at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.WebAii.Synchronization.Wait.ForCondition(Func`3 condition, Boolean invertCondition, Object custom, Int32 timeout)
   at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout, Boolean refreshElement)
   at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr, Boolean waitOnElement, Int32 timeout)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](HtmlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](String[] clauses)
   at ontariotest1365.Pages.OntSysSilverlightPage.get_SilverlightApp() in C:\Documents and Settings\dileep.s\My Documents\Visual Studio 2008\Projects\ontariotest1365\Project.cs:line 174
   at ontariotest1365.ontairotest133.ontairotest133_CodedStep12() in C:\Documents and Settings\dileep.s\My Documents\Visual Studio 2008\Projects\ontariotest1365\ontairotest133.aii.cs:line 194


regards
Dileep.s
Missing User
 answered on 06 Jul 2010
3 answers
119 views
First of all, is the free edition of WebAii acquired form ArtOfTest before the acquisition still supported?  I downloaded it about a year ago because it was free, and now I can't find any reference to it on the site, and the ArtOfTest.com site is basically defunct.

I've used that edition of the WebAii framework quite a bit, so I know it basically works.  So the problem I'm having now is completely baffling to me.

I'm trying to test navigation in an existing site, and going through a sequence of pages.  I get to a page that has (among other things) two buttons.  One is a "back" button that is an input element of type button with an onclick handler that calls a javascript function that just calls history.back().  The other is a submit button.

WebAii has no problem finding the submit button.  But when I tell it to click it, it is, to all appearances, clicking the back button.

Here's the relevant HTML from the site:

<div align="right"
    <table border="0" width="200" cellpadding="8" style="border-collapse: collapse" bordercolor="#E0DFE3"
        <tr> 
            <td> 
                <input type="button" value="<- Back" name="B2" onclick="cancelChange()" > 
            </td> 
            <td> 
                <input type="submit" value="Maint Details ->" name="lnkSubmit"
            </td> 
        </tr> 
    </table> 
</div> 
 

And here's the test code:
            HtmlInputSubmit maintDetailsButton = Find.ByAttributes<HtmlInputSubmit>("value=Maint Details ->"); 
            maintDetailsButton.Click(); 
 
            Assert.IsTrue(ActiveBrowser.Url.Contains(expectedPage), "URL {0} does not contain expected page {1}", ActiveBrowser.Url, expectedPage); 
 

The sequence of operations is working just fine when I click it manually, so I can see no evidence that it's the site's problem.  I've seen abundant evidence that it is, in fact, clicking the "Back" button and not the "Maint Details" button. (Fiddler shows no request issued when the click request is sent - consistent with executing history.back(), since the browser simply redisplays from it's cache.  When I click, it does, in fact, go to the previous page.  And finally, if I remove the "onclick" attribute from the back button, so that clicking on the button does nothing, then when execute the test code, the site does nothing - simply stays on the current page.)

I am completely baffled.  Can anyone give me a hint? 
Dave Hanna
Top achievements
Rank 1
 answered on 02 Jul 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?