SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Dec 2004
    Location
    hyderabad
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Type Mismatch error when executing simple function

    Hi All,

    When a trying to execute a small Function or Sub in QTP 8.2 it is displaying "Type Mismatch" error.

    Ex:
    Sub MsgTest ()
    Msgbox "Test"
    End Sub
    'Calling procedure in different ways.
    MsgTest
    Call MsgTest()

    In both the above scenario's im getting the same error "Type Mismathc MsgTest"

    Is it any setting/configuration problem in QTP8.2?

    PS: Before i used to execute the same

    Thanks in Advance,

    --Roopesh
    Roopesh T

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Type Mismatch error when executing simple func

    Where are you defining the function and where are you calling it? They have to be in the same actions and not different actions. Or else you need to declare them in a VBS file and associate it with the test.

  3. #3
    Junior Member
    Join Date
    Dec 2004
    Location
    hyderabad
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Type Mismatch error when executing simple func

    Hi Tarun,

    Yes, i am defining & calling the function or sub within the same action. i.e. As same as the above code which i have posted.

    But i identified the probelm...

    Case 1: i.e. When i trying to execute the code directly by calling the function or sub from (Call MsgTest() or MsgTest ) using Run From Step option in the Test Menu then the "Type Mismatch" error appearing.

    Case 2: Where as when tyring to execute the function from its definition (i.e. Sub MsgTest())then it is not giving any error.

    My understanding: In "Case 1: QTP doesn't know function or Sub definition, where as in "Case 2" QTP awares the same.
    Is this because of VBscript nature (i.e. Object-Based rather than Object-Oriented).

    Thanks
    Roopesh T

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Type Mismatch error when executing simple func

    If the function definition does not get executed and then there would be no function as such and hence you would get Type Mismatch error.

 

 

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 12.50%
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 06:21 PM.

Copyright BetaSoft Inc.