The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1
Roopesh Nair
Junior Member


Reged: 12/13/04
Posts: 2
Loc: hyderabad
Type Mismatch error when executing simple function
      #435521 - 11/23/07 06:19 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: Type Mismatch error when executing simple func [Re: Roopesh Nair]
      #435636 - 11/24/07 08:11 AM

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.

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
Roopesh Nair
Junior Member


Reged: 12/13/04
Posts: 2
Loc: hyderabad
Re: Type Mismatch error when executing simple func [Re: Tarun Lalwani]
      #435779 - 11/25/07 11:15 PM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: Type Mismatch error when executing simple func [Re: Roopesh Nair]
      #438110 - 12/02/07 11:56 AM

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.

--------------------
Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **

KnowledgeInbox RSS


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 73 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 8789

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5