Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to run script while function is used in script..
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi,

Following function I have preared by saving it in notepad file with .vbs extension.

----------------
Code:
Function Loadtime (a)
For count = 1 To 999999
Flag=a
If Flag = False Then
Wait (1)
Else
count = 999999
End If
Next
End Function

----------------
I have prepared following script by calling above function as follows-

----------------
Code:
URL = Datatable.Value("URL",Global)
User_name = Datatable.Value("User_name",Global)
Password = Datatable.Value("Password",Global)
Users = Datatable.Value("Users",Global)

systemutil.Run "iexplore",URL

'Load Login screen
a = Browser("InSync :: Login").Page("InSync :: Login").Image("topbanner").Exist
Call Loadtime (a)


Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtUsername").Set User_name
Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtPassword").Set Password
Browser("InSync :: Login").Page("InSync :: Login").WebButton("Login").Click

Browser("InSync :: Login").Close
----------------


After creating above test, I gone to File - Setting - Resources and clicked on the +(plus appears in green color) symbol and selected .vbs file in which function is described..

While runing script error "Type mismatch: 'Loadtime. Line(10): "Call Loadtime (a)" occurs.

Please let me know what is wrong in my script / function??

Thanks,
Mansi..


Attached Files Image(s)
   
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Line

Code:
a = Browser("InSync :: Login").Page("InSync :: Login").Image("topbanner").Exist
Call Loadtime (a)

is not proper. start using an alternate way, something like

Code:
if Browser("InSync :: Login").Page("InSync :: Login").Image("topbanner").Exist Then
a=True
Else
a=False
End If

Call Loadtime (a)

Regards,
Ankesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 635 11-05-2023, 03:55 PM
Last Post: lravi4u
  How do you Change Run mode mid script? Caleytown 6 7,360 03-25-2021, 08:27 AM
Last Post: RB26578
  picking different points in UFT using VB Script azjk786 0 1,069 12-14-2020, 09:57 AM
Last Post: azjk786
  script for mouseover rumitkon 2 2,032 02-20-2019, 12:52 AM
Last Post: rumitkon
  Call Stack in QTP Script smitapawar610 0 1,738 12-03-2018, 10:42 AM
Last Post: smitapawar610

Forum Jump:


Users browsing this thread: 2 Guest(s)