How can I write Test Script Language in QTP,
Can someone please write some sample of TSL,
and some command.
Please give various to try
Thanks Guys
Olateejay
Printable View
How can I write Test Script Language in QTP,
Can someone please write some sample of TSL,
and some command.
Please give various to try
Thanks Guys
Olateejay
QTP uses vbScript.
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
The above code will create the application object, start it and make it visible.
Hi, as Anshoo stated, qtp is based on vbscript.
When you state Test Script Language are you hinting at the kind of scripting used in winrunner ? incase yes, it would be difficult to implement the same in qtp as it is basically based on vbscript and more oriented towards event-driven and object oriented programming concepts.
Only possiblity is working with objects as Anshoo stated or depicted in code below -
set obj = CreateObject("InternetExplorer.Application").
obj.visible = true.
obj.navigate "http://www.google.com".
obj.statusbar = 1
while obj.readystate = true
strstatus = obj.statustext
if strstatus = "done" then
msgbox "application loaded completely"
end if
wend
Cheers...
Hi olateejay,
Normal DP (Descriptive Programming) decribes this way, in DP there are two types of objects.
1. Standard object
2. Custom object
The script below is for standard object,
eg: login screen systemutil.run"d:drivers\application\application.exe file
// (To call your exe file to action).
Set a=dialog("text:=login")
// (To know the wat kind of object the window is, just do the thing what I have mentioned, click on object spy, place the hand icon the window or what ever you want)
a.activate
// (To enable the dailog screen)
a.winedit("attached text:=user name:").set"name"
a.winedit("attached text:=password:").set"ur password" a.winbutton("text:=ok").click
[b]format for the above is [object("property:=value).operation][/b] winedit, winbutton, window, dailog these re standard objects.
For custom object, all the properties it will be winobject. I think this will help to understand a bit. If not, feel free to mail