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

BC30201: Expression expected , compiler error while running the test for WPF application

2 Answers 357 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Srinivasa
Top achievements
Rank 1
Srinivasa asked on 22 Oct 2019, 12:36 PM

Hi ,

I am new to the Telerik, exploring it for desktop application automation for my company.

I am not able to run the recorded steps for WPF application.

When i try to run its showing below compiler error

'ERROR' > C:\Users\localuser\Documents\Test Studio Projects\TestProject_desktop\Pages.g.vb(46,0) : error BC30201: Expression expected.

below is the code generated

Imports Telerik.WebAii.Controls.Xaml.Wpf
Imports System
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
Imports ArtOfTest.WebAii.Wpf

Namespace TestProject_desktop

    Public Class WPFTest
        Inherits BaseWebAiiTest

#Region "[ Dynamic Pages Reference ]"

        Private _applications As Applications
        
        '''<summary>
        ''' Gets the Applications object that has references
        ''' to all the elements, windows or regions
        ''' in this project.
        '''</summary>
        Public ReadOnly Property Applications() As Applications
            Get
                If (_applications Is Nothing) Then
                    _applications = New Applications(Manager.Current)
                End If
                Return _applications
            End Get
        End Property
        
#End Region
        
        ' Add your test methods here...


        <CodedStep("LeftClick on ImgGenerateLoginImage")> 
        Public Sub WPFTest_CodedStep()
            'LeftClick on ImgGenerateLoginImage
            Applications.iRIScopeexe.iRIScope.ImgGenerateLoginImage.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 34, 52, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, CType(0,System.Windows.Forms.Keys))
            
        End Sub

        <CodedStep("Set windowstate of 'Debug Window' to 'Minimized'.")> _
        Public Sub WPFTest_CodedStep1()
            'Set windowstate of 'Debug Window' to 'Minimized'.
            Manager.ActiveApplication.WaitForWindow("Debug Window").Window.Minimize
            
        End Sub

        <CodedStep("LeftClick on ImgGenerateLoginImage")> _
        Public Sub WPFTest_CodedStep2()
            'LeftClick on ImgGenerateLoginImage
            Applications.iRIScopeexe.iRIScope.ImgGenerateLoginImage.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 61, 45, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, CType(0,System.Windows.Forms.Keys))
            
        End Sub

        <CodedStep("Click BtnReasontestButton")> _
        Public Sub WPFTest_CodedStep3()
            'Click BtnReasontestButton
            Applications.iRIScopeexe.iRIScope.BtnReasontestButton.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 154, 30, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Pixel)
            
        End Sub
    End Class
End Namespace

2 Answers, 1 is accepted

Sort by
0
Srinivasa
Top achievements
Rank 1
answered on 25 Oct 2019, 07:20 AM
Can any one help me please. I am stuck here from past 10 days.I am new to Telerik. Please help me
0
Elena
Telerik team
answered on 25 Oct 2019, 11:22 AM

Hello Srinivasa,

I am sorry to know you have encountered such error within the Test Studio project. 

I noticed you have converted some of the steps into code - did you change anything in these? 

Did you try to edit any of the elements' find expression?

The error you got is related to the Pages file, which contain definitions for all elements in project. Since this is generated dynamically by each attempt for test run, I suspect that there is something wrong with any of the elements in the project. Will it be possible to share the project with for further exploration? 

Another thing you can give a try to, is to create a new project and record a sample new test against the application. Are you then able to execute it successfully? 

I am looking forward to hearing back from you. Thank you for your cooperation in advance.

Regards,
Elena
Progress Telerik

 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Srinivasa
Top achievements
Rank 1
Answers by
Srinivasa
Top achievements
Rank 1
Elena
Telerik team
Share this question
or