This is a migrated thread and some comments may be shown as answers.

Help with my first Testing Studio project

1 Answer 45 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 26 Jan 2015, 12:35 PM
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

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 29 Jan 2015, 12:43 PM
Hello Christian,

Thank you for contacting us.

You have two options here:

1. Create a Test Studio project in Test Studio and then export it to Visual Studio. In Visual Studio you have an option to convert all steps to code. See this article.

2. Create a Test Studio project directly in Visual Studio.

You cannot convert "Handle Download Dialog" step into code. This is done by design.

You should write the code for handling the dialog manually. See this article.

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Christian
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or