Telerik Forums
Testing Framework Forum
2 answers
69 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
109 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
125 views
Can WebAii simulate 100 users? or 1000 users?
SD
Top achievements
Rank 1
 answered on 17 Aug 2010
4 answers
127 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
171 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
175 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
123 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
131 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
180 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
10 answers
213 views
Hi everyone.

We are testing a web-application with framed main window, so our tests look lite that:

Settings mySettings = new Settings(BrowserType.FireFox, @"d:\");
mySettings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
Manager myManager = new Manager(mySettings);
 
myManager.Start();
myManager.LaunchNewBrowser();
 
myManager.ActiveBrowser.NavigateTo("file:///d:/test.html");
Element mybtn = myManager.ActiveBrowser.Frames[0].Find.ByName("press_me");
HtmlControl htmlControl = new HtmlControl(mybtn);
 
//fine in IE and FF
htmlControl.Click();
 
//error in FF only
htmlControl.MouseClick(MouseClickType.LeftClick);
 
//error in FF only
myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, mybtn.GetRectangle());
 
//error in IE and FF
myManager.ActiveBrowser.Actions.Click(mybtn);
 
//error in FF and IE
myManager.ActiveBrowser.Actions.InvokeEvent(mybtn, ScriptEventType.OnClick);
 
myManager.Dispose();

Here you can see finding a button in the first frame and then clicking it in five different ways.

The html code is like that:

<html>
<head></head>
<frameset cols="25%,*,25%">
  <frame src="frame_a.html" />
  <frame src="frame_b.html" />
  <frame src="frame_c.html" />
</frameset>
</html>

and the frame_a.html is
<html>
<body>
<input type="button" name="press_me" value="press_me" onclick="alert('Hello world!')"/>
</body></html>


But after I tested the code, I discovered that FF fails to click on it almost in every case, and IE fails in the last two.
Though the code and HTML page seem valid, could somebody, please, tell what is wrong?
Using IE 7, FF 3.6.7 and 3.5.1, WebAii 2.0 the lates build.

The error produced is like
Unhandled Exception: ArtOfTest.WebAii.Exceptions.ExecuteCommandException: Execut
eCommand failed!
InError set by the client. Client Error:
System.ArgumentException: Tag collection is either empty or has less elements th
an the element occurrence requested. RequestedIndex: '0', ElementLength: '0'
   at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage
 id)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(Browse
rCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserCla
ss ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'Click',Target:'ElementId (ta
gName: 'input',occurrenceIndex: '0')',Data:'',ClientId:'Client_44818831-9568-46b
5-9a23-3ad5285d5c64',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InErr
or:'True',Response:'System.ArgumentException: Tag collection is either empty or
has less elements than the element occurrence requested. RequestedIndex: '0', El
ementLength: '0'
   at ArtOfTest.InternetExplorer.IECommandProcessor.FindElement(ElementIdMessage
 id)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(Browse
rCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserCla
ss ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.
 
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand reques
t)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boole
an performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Actions.Click(Element targetElement)
   at testMouseClick.Program.Main(String[] args) in C:\Documents and Settings\My Documents\Visual Studio 2008\Projects\testMouseClick\testMouseClick
\Program.cs:line 42


Thanks
Yaroslav
kovyar
Top achievements
Rank 1
 answered on 10 Aug 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?