Telerik Forums
Testing Framework Forum
1 answer
112 views
I've just gotten started using the testing framework.
I see that I can enable proxies by setting:
settings.Web.UseHttpProxy = true;

The description talks about the "built in http proxy" but I've been searching around without being able to get more info on it.

Where do I input the proxies?
Boyan Boev
Telerik team
 answered on 12 Feb 2015
1 answer
186 views
Hi,

I do have following HTML code:

... <a href='#'><div class='navTileLabel' style='color:#000000;' title='Testrubrik'>Testrubrik</div></a>...

it is part of a framesource.

I can find this element by following code:

Browser frame = myManager.ActiveBrowser.Frames.ById("cat");
Element testrubrik = frame.Find.ByAttributes("title", "Testrubrik");

that works. And I would like to simulate a click on this element:

frame.Actions.Click(testrubrik);

that works not. Even if I use another way:

myManager.ActiveBrowser.Actions.Click(testrubrik);

or

myManager.Desktop.Mouse.Click(MouseClickType.LeftClick, testrubrik.GetRectangle());

it does not what I want.

What can I do to execute a click on this element?

Best regards





Boyan Boev
Telerik team
 answered on 11 Feb 2015
3 answers
103 views
I have an HTTPResponseHandler defined that examines the content returned by the server, to see if the server has sent back the response I am waiting for. The response from the server forthe ContentEncoding parameter of the response is 'gzip'. In IE, I simply look at the string response from Encoding.ASCII.GetString(e.Response.Content) to see if it is the response from the server I am expecting, and all is well. However, when the browser is Chrome, the Response.Content is not being decompressed by the WebAii proxy, and I get a gzipped string back - so I cannot tell if I'm getting what I want back from the server - is there something in the proxy I have to do to tell it to decompress the response?
Cody
Telerik team
 answered on 05 Feb 2015
1 answer
91 views
First of all I would like to clarify that I'm not sure If I'm doing this in the right way.

I've figured out how to generate the code of the Test recorded in Testing Studio (I'm not suere if I did it in the proper way because seems not capable to generate all the code at once), then I created a new Visual Basic Test Studio Project on VS, and I added a new class with the generated code.

The first problem I see is that the Pages member does not contains the page of the Test, what I missed and how I can fix this?

The second problem I found is that Test Studio does not shows me an "Edit In Code" option  in a "Handle Download Dialog" step to generate its code that should save a picture on local disk, then which alternatives I have to download a picture from a website?

Imports Telerik.TestingFramework.Controls.KendoUI
Imports Telerik.WebAii.Controls.Html
Imports Telerik.WebAii.Controls.Xaml
Imports System.Collections.Generic
Imports System.Text
Imports System.Linq
 
Imports ArtOfTest.Common.UnitTesting
Imports ArtOfTest.WebAii.Core
Imports ArtOfTest.WebAii.Controls.HtmlControls
Imports ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts
Imports ArtOfTest.WebAii.Design
Imports ArtOfTest.WebAii.Design.Execution
Imports ArtOfTest.WebAii.ObjectModel
Imports ArtOfTest.WebAii.Silverlight
Imports ArtOfTest.WebAii.Silverlight.UI
 
Namespace new_test_project
 
    Public Class WebTest
        Inherits BaseWebAiiTest
#Region "[ Dynamic Pages Reference ]"
 
        Private _pages As Pages
 
        ''' <summary>
        ''' Gets the Pages object that has references
        ''' to all the elements, frames or regions
        ''' in this project.
        ''' </summary>
        Public ReadOnly Property Pages() As Pages
            Get
                If _pages Is Nothing Then
                    _pages = New Pages(Manager.Current)
                End If
                Return _pages
            End Get
        End Property
 
#End Region
 
        ' Add your test methods here...
        <CodedStep("Navigate to : 'http://www.cgwallpapers.com/'")> _
        Public Sub WebTest_CodedStep1()
            ' Navigate to : 'http://www.cgwallpapers.com/'
            ActiveBrowser.NavigateTo("http://www.cgwallpapers.com/", True)
 
        End Sub
 
        <CodedStep("Enter text 'username' in 'Input0Text'")> _
        Public Sub WebTest_CodedStep2()
            ' Enter text 'username.com' in 'Input0Text'
            Actions.SetText(Pages.CGWallpapersCom.Input0Text, "username")
 
        End Sub
 
        <CodedStep("Enter text 'password' in 'Input0Password'")> _
        Public Sub WebTest_CodedStep3()
            ' Enter text 'password' in 'Input0Password'
            Actions.SetText(Pages.CGWallpapersCom.Input0Password, "password")
 
        End Sub
 
        <CodedStep("Click 'LoginDiv'")> _
        Public Sub WebTest_CodedStep4()
            ' Click 'LoginDiv'
            Pages.CGWallpapersCom.LoginDiv.Click(False)
 
        End Sub
 
        Public Sub WebTest_CodedStep5()
            ActiveBrowser.NavigateTo("http://www.cgwallpapers.com/members/viewwallpaper.php?id=1764&res=1920x1080", True)
 
        End Sub
 
    End Class
 
End Namespace

Boyan Boev
Telerik team
 answered on 29 Jan 2015
2 answers
100 views
Hi

Someone has recommended me to try and use Testing Framework for my purposes, which are login in this wallpaper website http://www.cgwallpapers.com/members/index.php using my user account and then download all the wallpapers, my navigator is Firefox.

I'm a totally beginner about web automation relateds, then I would like to know some basic things about Testing Framework that are not clear for me even after seen the product video introduction which only shows some expert features (all have to be said).

1) I cannot get a proper idea of what sort of product Testing Framework is at all, to have a better idea maybe I could say that Testing Framework is a product comparable to Windows UI Automation namespace which its features implemented in a application/library but more powerfull?.

2) Testing Framework can be used under a WinForms project?, if yes then how to start using it? (I don't see a plugin menu in VS or anything else), there is a beginners example?.

3) Testing Framework can be used under an WPF project?.

4) Because Testing Framework is a profesional product, it is oriented also for beginners that maybe does not know the basics of automation, or is only oriented for experts programmers who knows what they are doing and how they can do it? (sincerelly, please).

5) Testing Framework shoul be capable to perform the task that I mentioned in that website under that navigator?.

Thanks for read!
Boyan Boev
Telerik team
 answered on 29 Jan 2015
10 answers
988 views
I'm using the Testing Framework (internal build 624) and I am able to run tests in IE and FF, but when I try to run the test using Chrome (v12.0.742.122), Chrome launches and then hangs opening the page http://localhost:#####/WebUI?########## . The browser displays the text "Preparing browser for automation..." and the test fails.

I've followed the instructions for configuring Chrome that seemed to help at least one other user (http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/configure-your-browser/chrome.aspx), but the configuration steps did not solve the problem for me.

I'm running the tests on Win7 with VS2010.  The WebUI extension used by Chrome is 2011.1.624.0.

Are there additional configuration steps that need to be followed?
Thanks!

Boyan Boev
Telerik team
 answered on 28 Jan 2015
5 answers
82 views
Hello Telerik Team!

I have an element which I need to mouse over, and simply invoking the OnRollOver event doesn't work.

All other browsers seem to have no issue, but this line in FF doesn't run properly.
Rectangle eleRect = hoverOver.GetRectangle();

The co-ordinates returned in FF are as follows, which causes the mouse to move into the top left corner.
X: -2147482642, Y:-2147483308

As the title mentions, this is happening inside of an IFrame, which I'm able to find without any issue.
Boyan Boev
Telerik team
 answered on 27 Jan 2015
1 answer
100 views
i want to get the automation peer associated with a silverlight custom control using telerik testing framework. HelpText property of automation peer is used to exposed the required information. i want to get that information(HelpText of automation peer) from the custom control.

i am trying the following way:

Manager.LaunchNewBrowser(BrowserType.InternetExplorer);         
ActiveBrowser.NavigateTo("http://localhost:1031/SampleSilverlightAppTestPage.aspx");            
SilverlightApp app = ActiveBrowser.SilverlightApps()[0];          
Assert.IsNotNull(app);           
FrameworkElement myCustomControl = app.Find.ByName("myCustomControl");

After this i am using GetProperty method to get the "HelpText" property as :

string helpText = (string)myCustomControl.GetProperty(new AutomationProperty("HelpText", typeof(string))); 


But it gives me error saying : "HelpText" property is not a valid automation property.

How can i exposed the automation peer of silverlight control in telerik testing framework.?




Ivaylo
Telerik team
 answered on 20 Jan 2015
22 answers
497 views
Hi

I'm getting an error when doing waitforelement to disappear, see below.

Any ideas to whats going wrong?, if i put in a sleep of 2sec or so it works. My guess is that the wait happens between dom refreshes or something like that but i don't know how to get around it.

Whats happening on the page, is that click save Btn closes a modal popup and I attempt to wait for it to disappear.

Code:
private HtmlFindExpression modalH2 = new HtmlFindExpression("xpath=//div[@id='tf-modal-window-top']/h2");
 
_Frame.Find.ByExpression<HtmlAnchor>(saveButton).Click(true);
ActiveBrowser.WaitForElement(modalH2, SharedValues.LongtTimeout, true);


Error:
Test method Iit.TradingFloor.TestWebUI.UrlRedirectionTests.UrlRedirection_Admin_SearchRedirection threw exception:
System.ApplicationException: Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition. Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Refresh() failed due to an unexpected exception. ---> ArtOfTest.WebAii.Exceptions.FindException: Find Details:
- No FindParams defined.
- Start Element: [Element: 'html:0']
 
 
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh(Boolean forceDomTreeRefresh)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at ArtOfTest.Common.WaitAsync.CallRefreshIfNeeded[T](T target)
   at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam)

Cody
Telerik team
 answered on 19 Jan 2015
2 answers
39 views
I want to get the HelpText property of a custom silverlight control using ArtOfTest.webii .I have added automation peer to the HelpText property of that control,so want to fetch the HelpText using testing framework
I am using FrameworkElement to store the custom silver light control.I have tried using automation properties ,but it say HelpText is not a valid automation property.          Please help in this.I need it urgent.
Cody
Telerik team
 answered on 17 Jan 2015
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?