End of statement expected when define a buttonList as List

Ask general questions here.
shellyhu
Posts: 9
Joined: Mon Sep 29, 2014 9:07 am

End of statement expected when define a buttonList as List

Post by shellyhu » Mon Nov 03, 2014 6:58 am

Hi,

I met a problem. The code described as following.

Dim ButtonList As New List(Of String) From { _
"/dom//frameset/frame[@id='tabs']/body//div[@id='Home']", _
"/dom//frameset/frame[@id='tabs']/body//div[@id='Product']", _
"/dom//frameset/frame[@id='tabs']/body//div[@id='Support']"}

When I build it and the error description is: End of statement expected. (BC30205)

I don't know what's wrong with it.

Thank you.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: End of statement expected when define a buttonList as List

Post by Support Team » Wed Nov 05, 2014 11:11 am

Hello shellyhu,

Unfortunately, we are not able to reproduce this issue. The code works perfectly fine:

Code: Select all

Module Module1

    Sub Main()

        Dim ButtonList As New List(Of String) From {
                                                        "/dom//frameset/frame[@id='tabs']/body//div[@id='Home']",
                                                        "/dom//frameset/frame[@id='tabs']/body//div[@id='Product']",
                                                        "/dom//frameset/frame[@id='tabs']/body//div[@id='Support']"
                                                        }

    End Sub

End Module
Further information regarding this issue can be found here: http://msdn.microsoft.com/en-us/library/8dy0ah20.aspx

Regards,
Robert
.
Image

shellyhu
Posts: 9
Joined: Mon Sep 29, 2014 9:07 am

Re: End of statement expected when define a buttonList as List

Post by shellyhu » Tue Nov 11, 2014 8:11 am

Hi Robert

Thank you very much.

I copy your code in my Ranorex (5.0.2), but the same error occurs.

Do you think it is environment problem ?

Shelly

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3914
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: End of statement expected when define a buttonList as List

Post by odklizec » Tue Nov 11, 2014 8:52 am

Hi,

I would suggest you to try to update your Ranorex (5.0.2?) with the latest Ranorex 5.2. The code compiles fine with latest Ranorex.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

shellyhu
Posts: 9
Joined: Mon Sep 29, 2014 9:07 am

Re: End of statement expected when define a buttonList as List

Post by shellyhu » Thu Nov 13, 2014 11:01 am

Hi Odklizec

I upgrade Ranorex to 5.2, but the same error still exists : End of statement expected.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3914
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: End of statement expected when define a buttonList as List

Post by odklizec » Thu Nov 13, 2014 11:09 am

Could you try to create a new solution with this piece of code? Do you get the same result?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

shellyhu
Posts: 9
Joined: Mon Sep 29, 2014 9:07 am

Re: End of statement expected when define a buttonList as List

Post by shellyhu » Fri Nov 14, 2014 10:34 am

Hi Odklizec,

I try this code in a new module, it is still existing the same error when build it.

But I try it on another computer, the code can be built successfully. So I am supposed that it is the environment problem, I will check what's the difference between them.

Thank you for your help.

Shelly