SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2

Thread: strange error

  1. #1
    Senior Member
    Join Date
    Jul 2008
    Location
    Mumbai,India
    Posts
    145
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    strange error

    while demonstrating an eg of dictionary obj i copied and pasted this code

    [ QUOTE ]

    Dim dict ‘ Create a variable.
    Set dict = CreateObject(”Scripting.Dictionary”)
    dict.Add “Company”, “HP” ‘ Adding keys and corresponding items.
    dict.Add “Tool”, “QuickTest Pro”
    dict.Add “Website”, “LearnQTP”
    dict.Add “Country”, “India”


    [/ QUOTE ]

    from the web link
    http://www.learnqtp.com/dictionary-object-qtp-use/

    and then added a few lines
    [ QUOTE ]

    If dict.exists("Country") Then
    Msgbox "Key Exists"
    else Msgbox "No such Key"
    End If


    [/ QUOTE ]
    this on execution gave the error

    [ QUOTE ]

    The test run cannot continue due to a syntax error.

    Invalid characte

    [/ QUOTE ]

    i then deleted and typed the same stuff again

    [ QUOTE ]

    Dim dictOBJ
    Set dictOBJ = CreateObject ("scripting.dictionary")
    dictOBJ.Add "Country","INDIA"

    If dictOBJ.exists("Country") Then
    Msgbox "Key Exists"
    else Msgbox "No such Key"
    End If


    [/ QUOTE ]

    which ran without error , Point is i have used Dict obj so many times and never came across such a message. Can some one explain .
    @;-
    To err is to CODERS , to TEST is divine

    Keshava

  2. #2
    Member
    Join Date
    Feb 2007
    Posts
    347
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: strange error

    As you mentioned, that you copy pasted the code first time, then I think the some character format was not recognised by qtp as may be quote('")first time.

    Also you can see the visible difference in your both quotes.
    Vishal Aggarwal
    Test Architect
    http://testocean.blogspot.in/

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:59 AM.

Copyright BetaSoft Inc.