Telerik Forums
Testing Framework Forum
1 answer
107 views
Hi, 

I've got the following html control:
<td class="dr-dscr-button rich-datascr-button" onclick="Event.fire(this, 'rich:datascroller:onscroll', {'page': 'fastforward'});">»</td>

On some occasions, I've got 2 of those 'guys' (">>") on the screen but usually I need to click the one that resides on the button of the page. 
For some reason the following was not helpful and returns count of 0 as if the control was not found.  

var forward = (from b in Manager.ActiveBrowser.Find.AllControls<HtmlControl>() where b.ToString().Contains("»") select b);
                 
Console.WriteLine(forward.Count().ToString());
This works in case there's one control on the screen but it's easier to have all controls in a list to be managed...
HtmlControl forward = Manager.ActiveBrowser.Find.ByXPath<HtmlControl>("//tr/td[text()=\"»\"]");

Any ideas ?

Ta.

SD
Top achievements
Rank 1
 answered on 18 Aug 2010
2 answers
87 views
Hi Guys, 

I've been using some thing like this in the past to retrieve the number of times a certain image appears on the screen in a given time:
getXpathCount("//img[@src=\"/images/someImage.gif\"]");

Does Webaii offer a similar mechanism (Not necessarily using xpath...) ?

Ta. 
SD
Top achievements
Rank 1
 answered on 17 Aug 2010
1 answer
121 views
HI,

  I am new to WebAii framework. Could you please some one help me where to start and what are the pre-requsite for starting working with WebAii.

Thanks
SaranKumar
Konstantin Petkov
Telerik team
 answered on 17 Aug 2010
2 answers
135 views
Can WebAii simulate 100 users? or 1000 users?
SD
Top achievements
Rank 1
 answered on 17 Aug 2010
4 answers
140 views
I am new to WebAii. I have a problem when finding a RadMenu control in my asp.net app. Here is my code.

RadMenu menu = Find.ById<RadMenu>("ctlMainMenu");

When I run the test, it throws the following exception.

System.Security.VerificationException : Method ArtOfTest.WebAii.Core.Find.ById: type argument 'Telerik.WebAii.Controls.Html.RadMenu' violates the constraint of type parameter 'TControl'.


Any thought?
Chhuong
Top achievements
Rank 1
 answered on 13 Aug 2010
9 answers
191 views
Hi There, I'm trying to use silverlight hyperlinkbutton class as below for tests.

I see below code working for W2k8 and but not for Win7. Anyone hitting the same issue, some seetings need to be changed for win7?

private SilverlightApp App
{
    get
    {
        return this.Manager.ActiveBrowser.SilverlightApps()[0];
    }
}
private HyperlinkButton Button
{
    get
    {
        return this.UploadApp.FindName<HyperlinkButton>("_Button");
    }
}
public void ClickUpload()
{
    this.Button.User.Click(); //<<==== this doesn;t fire click for button specified. 
}

Thanks,
Saravanan
Cody
Telerik team
 answered on 13 Aug 2010
8 answers
189 views
Hi all,

finally we have managed to reproduce errors we have been experiencing with FF in our application.
So, now we can show you the problem.

The test layout can be found at my free hosting.
The code (both layout and test) may be downloaded from here.

The test code is: 
var mySettings = new Settings(BrowserType.FireFox, "c:\\log");
mySettings.ClientReadyTimeout = 200000;
 
// Set to false if you are annoyed by red-yellow popups.
mySettings.AnnotateExecution = true;
mySettings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
var m = new Manager(mySettings);
m.Start();
m.LaunchNewBrowser();
if (!m.ActiveBrowser.Window.IsMaximized)
{
    m.ActiveBrowser.Window.Maximize();
}
 
m.Settings.ExecutionDelay = 100;
m.ActiveBrowser.NavigateTo("http://aspspider.ws/kovyar");
 
m.ActiveBrowser.AutoDomRefresh = true;
m.ActiveBrowser.WaitUntilReady();
 
Element loginfield = m.ActiveBrowser.Find.ById("ctl00_mainContentPlaceHolder_tbLogin");
Element passwfield = m.ActiveBrowser.Find.ById("ctl00_mainContentPlaceHolder_tbPassword");
m.ActiveBrowser.Actions.SetText(loginfield, "login"); //just to put anything
m.ActiveBrowser.Actions.SetText(passwfield, "pwd");
Element mybtn = m.ActiveBrowser.Find.ById("ctl00_mainContentPlaceHolder_LogInButton");
mybtn.As<HtmlControl>().Click();
 
m.ActiveBrowser.WaitForUrl("StartPage.aspx", true, 10000);
 
m.ActiveBrowser.WaitForFrame(new FrameInfo("MainFrameSet", null, null, 0), 10000);
m.ActiveBrowser.RefreshDomTree();
var mf = m.ActiveBrowser.Frames.ById("MainFrameSet");
 
m.ActiveBrowser.WaitForFrame(new FrameInfo("frmLeft", string.Empty, string.Empty, 0), 10000);
m.ActiveBrowser.RefreshDomTree();
 
var f = m.ActiveBrowser.Frames.ById("frmLeft");
f.WaitUntilReady();
f.RefreshDomTree();
var t = f.Find.ById<HtmlInputText>("treeFilterText");
 
t.Click();             // this method doesn't work
t.Text = "Hey Test!"// neither does that.

And produces the following error:

ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
mozCommandProcessor: FindElement(): Tag collection is either empty or has less elements than the element occurrence requested.TagName: , Occurrence Requested: -1, All Tags Collection length: 0
BrowserCommand (Type:'Information',Info:'FrameRectangle',Action:'NotSet',Target:'null',Data:'2',ClientId:'Client_8c806e49-0c9d-48ed-a729-e2c2d2978a5c',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'mozCommandProcessor: FindElement(): Tag collection is either empty or has less elements than the element occurrence requested.TagName: , Occurrence Requested: -1, All Tags Collection length: 0')
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.Core.Browser.ExecuteCommand(BrowserCommand request)
at ArtOfTest.WebAii.Core.FrameInfo.GetRectangle()
at ArtOfTest.WebAii.ObjectModel.Element.GetRectangle()
at ArtOfTest.WebAii.Core.Actions.AnnotateElement(Element targetElement, String message, Boolean isNative)
at ArtOfTest.WebAii.Core.Actions.AnnotateElement(Element targetElement, String actionName, String data, Boolean isNative)
at ArtOfTest.WebAii.Core.Actions.Click(Element targetElement)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.Click()
at Tests.Test.Test1() in Test.cs: line 60

Sad but true, it should work, but it doesn't.

Thus we would like our tests work, so it will be great if you tell us how to deal with it.
P.S. This layout is quite similar to the real one. In our application no methods such as Click(), MouseHover() etc work.

Thanks in advance for any ideas.

All the best,
Yaroslav

P.S. Maybe, the problem exists because of our layout being wrapped in one <iframe> element.
I mean that there is one parent iframe which contains all the other elements.

P.P.S. We are using the latest build of WebAii 2.0 and Firefox 3.6.8.
kovyar
Top achievements
Rank 1
 answered on 12 Aug 2010
3 answers
136 views
Hi,

I'm trying to automate Silverlight child windows using the free WebAii automation framework (latest available official release). I'm using the popup tracker provided in the Telerik.WebUI.PopupTracker assembly shipped with this build to track my child window in my application, which works without any indication of an error. However, when I try to find my child window by using app.Find.ByAutomationId("MyDialogAutomationId") and various other variations on that theme, I get a TimeoutException.

Is this a known issue, and if so, is there a workaround? Is there something else I have to do to make automation of Silverlight child windows possible?

Cheers,
Kristian
Kristian Freed
Top achievements
Rank 1
 answered on 11 Aug 2010
5 answers
146 views
Installed WebAii Automation Framework Version 2.0 of July 13, 2010. created a simple test.  ActiveBrowser.ContainsText("ArtOfTest") does not work for FF, though it works for IE. Not sure what went wrong.

 public void SampleWebAiiTest()
        {
            // Launch a browser instance
            //Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
            Manager.LaunchNewBrowser(BrowserType.FireFox);

            // The active browser
            ActiveBrowser.NavigateTo("http://www.google.com");

            // Find the google search box and set it to "ArtOfTest";
            Find.ByName<HtmlInputText>("q").Text = "ArtOfTest";

            // Click the Search button
            Find.ByName<HtmlInputSubmit>("btnG").Click();

            // Validate the search contain the 'ArtOfTest' text
            bool art = ActiveBrowser.ContainsText("ArtOfTest");
            Assert.IsTrue(art);
        }
Cody
Telerik team
 answered on 11 Aug 2010
4 answers
201 views
Any action that requires a simulated click (User.Click), e.g. click cell in grid, click scrollbar in grid, etc. does not seem to work if the test machine is in locked state (Windows Key + L)

This is affecting our build server as it is goes into locked state after 15 minutes of activity and is unable to complete the UI system tests.

Is there any way to allow the simulated clicks to work as intended when a machine is locked?

         var dataGrid = _silverlightApp.Find.ByAutomationId<DataGrid>("DataGrid");
         dataGrid.Rows[0].User.Click()

or

         var dataGrid = _silverlightApp.Find.ByAutomationId<DataGrid>("DataGrid");
         dataGrid.Rows[0].User.Click()
Kiran
Top achievements
Rank 2
 answered on 10 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?