Micro Focus QTP (UFT) Forums
type mismatch error in QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: type mismatch error in QTP (/Thread-type-mismatch-error-in-QTP)



type mismatch error in QTP - QAlearningQTP - 02-04-2014

[attachment=1285]Good Day,

I'm currently learning QTP and for some reason am getting a type mismatch error when I try to call the functions Login, Booking and Logout.

I've correctly linked the function library file to my script below so I'm not sure why I'm getting this error.

Here's the function library:

Login "jsmoliak"
Booking "Sydney", "Kurt", "Cobain"
Logout

and the script with the function calls highlighted below. I can't figure out why I'm getting this error and any assistance is appreciated. I'm using the 30 day trail of UFT v11.50 build 5439.

Function Login (sUsername)
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("username").Set sUsername
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("password").SetSecure "52e9df6063686d902c8aefb6ad4d932057aaa832a247" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("password")_;_script infofile_;_ZIP::ssf2.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Login").Click
End Function @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Login")_;_script infofile_;_ZIP::ssf3.xml_;_

Function Booking (sLocation, sFirstName, sLastName)

Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("location").Select sLocation
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("room_nos").Select "2 - Two" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("room nos")_;_script infofile_;_ZIP::ssf5.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("adult_room").Select "2 - Two" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("adult room")_;_script infofile_;_ZIP::ssf6.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Search").Click @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Search")_;_script infofile_;_ZIP::ssf7.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebRadioGroup("radiobutton_3").Select "3" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebRadioGroup("radiobutton 3")_;_script infofile_;_ZIP::ssf8.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Continue").Click @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Continue")_;_script infofile_;_ZIP::ssf9.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("first_name").Set sFirstName @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("first name")_;_script infofile_;_ZIP::ssf10.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("last_name").Set sLastName @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("last name")_;_script infofile_;_ZIP::ssf11.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("address").Set "Kingdome" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("address")_;_script infofile_;_ZIP::ssf12.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("cc_num").Set "7777777777777777" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("cc num")_;_script infofile_;_ZIP::ssf13.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("cc_type").Select "VISA" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("cc type")_;_script infofile_;_ZIP::ssf14.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("cc_exp_month").Select "November" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("cc exp month")_;_script infofile_;_ZIP::ssf15.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("cc_exp_year").Select "2020" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebList("cc exp year")_;_script infofile_;_ZIP::ssf16.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("cc_cvv").Set "286" @@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebEdit("cc cvv")_;_script infofile_;_ZIP::ssf17.xml_;_
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Book Now").Click
End Function
@@ hightlight id_;_Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").WebButton("Book Now")_;_script infofile_;_ZIP::ssf18.xml_;_
Function Logout
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").Link("Logout").Click
Browser("AdactIn.com - Hotel Reservatio").Page("AdactIn.com - Hotel Reservatio").Link("Click here to login again").Click
End Function


RE: type mismatch error in QTP - QAlearningQTP - 02-04-2014

Issue got resolved. I had the function script and the function library contents switched by accident. I place the 3 parameters in the function script and everything else in the function library and re-ran and it worked accordingly TongueTongue