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

3 posts, 0 answers
  1. Srinivasa
    Srinivasa avatar
    2 posts
    Member since:
    Sep 2019

    Posted 22 Oct Link to this post

    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. Srinivasa
    Srinivasa avatar
    2 posts
    Member since:
    Sep 2019

    Posted 25 Oct Link to this post

    Can any one help me please. I am stuck here from past 10 days.I am new to Telerik. Please help me
  3. Elena
    Admin
    Elena avatar
    1144 posts

    Posted 25 Oct Link to this post

    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!
Back to Top