Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
type mismatch error in QTP
#1
Solved: 10 Years, 2 Months, 3 Weeks ago
    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
Reply
#2
Solved: 10 Years, 2 Months, 3 Weeks ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Different Type of Dropdown Selector zunebuggy 6 2,842 05-01-2018, 06:46 PM
Last Post: zunebuggy
  cannot use the type method on object and submit is not working jove1776 5 8,380 01-27-2015, 10:08 PM
Last Post: Parke
  How to import .xlsx file type to QTP qtped 3 6,320 03-27-2014, 01:33 PM
Last Post: Ankur
  QTP 11.52---Type mismatch error srinijg20 4 4,118 08-26-2013, 03:51 PM
Last Post: GregHicks
Question Deatils on Split action with Nested type sams001 0 3,175 10-30-2012, 03:03 PM
Last Post: sams001

Forum Jump:


Users browsing this thread: 1 Guest(s)