Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to record script in QTP?
#1
Not Solved
Hi,

I am new to QTP. I am facing problem to record script.
Can anyone give me the step by step procedure to record script for Login page.

Thanks in advance
Ashita Sad
Reply
#2
Not Solved
Hi Ashita,

Here are the steps you need to follow:
1. Open QTP. (Select ActiveX and Visual Basic from home screen)
2. Open Flight Application (For Example: "E:\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe")
3. Click "Record" button in QTP (You can find it in top left corner of the screen or simply Press "F3" key or Goto Automation Menu >> Record.
4. "Record and Run Settings" window will open. (Select "Window Application" tab)
5. By default first radio button will be selected.
6. Click ok (Now QTP will be in recording mode)
7. Select "Flight Login" dialog from taskbar or by pressing Allt+Tab
8. By default cursor will be blinking at "Agent Name" text field.
9. Enter Agent Name
10. Click on Password with the help of mouse. (Please dont hit 'Tab' key. Please avoid keystrokes when using QTP or LoadRunner)
11. Enter password as "mercury"
12. Click on "OK" or "Cancel" as per your requirement. (Here for demo purpose I choose "Cancel")
13. Click on "Stop" button or press "F4" to stop recording.
14. If you followed above steps, then you can see below script generated in "Expert View" in QTP

Code:
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "forrest"
Dialog("Login").WinEdit("Password:").SetSecure "4e5d6a8e3c95d0b55b8d07a54411012a0a6f2821"
Dialog("Login").WinButton("Cancel").Click

Please reply whether its worked or not. If not, then please mention clearly the method you are following when recording.

Regards,
- Forrest Gump
Reply
#3
Not Solved
Hi,

Thanks for your help. It's working.

Thanks
Ashita.
Reply
#4
Not Solved
Hi,

I am facing problem in doing parameterization. I am sending you the script for how i am doing parameterization. Tell me where I am doing wrong?

1. First I have created the script for login page.
Agent name, Password and OK button because for recording script these steps remain same.

2. one way of doing parameterziation is I am doing copy paste the script in expert view and change the agent name and password manually.

3. The other way I am using parameterization Below are the steps:

a) Click on keyword view. Then click on the Parameterization icon <=>
b) Value configuration dialog box opens
c) Click radio button parameter
By default it takes name P_text
I renamed it Agentname and then click OK.

d) In the global data sheet the column name Agent name is created and value guru automatically comes.

script for this is below:
Code:
invokeapplication("C:\ProgramFiles(x86)\MercuryInteractive\QuickTestProfessional\bin\QTPro.exe")
dialog("Login").WinEdit("AgentName").SetDataTable("agentname,dtGlobalSheet")
dialog("Login").WinEdit("Password").SetDataTable("password,dtGlobalSheet")
dialog("Login").WinButton("OK").Click
Wait(1)


Now When i Try to run this It's giving me an error.
Cannot find the "AgentName" object "Parent Login"(class Dialog). Verify that parent properties match an object currently displayed in your application.

Please help me in parameterization.
:-(
Thanks & Regards,
Ashita
Reply
#5
Not Solved
Change your script as below:

Code:
invokeapplication("C:\ProgramFiles(x86)\MercuryInteractive\QuickTestProfessional\bin\QTPro.exe")
dialog("Login").WinEdit("AgentName").Set DataTable("agentname",dtGlobalSheet)
dialog("Login").WinEdit("Password").Set DataTable("password",dtGlobalSheet)
dialog("Login").WinButton("OK").Click
Wait(1)

Check your column name carefully ,It should be "agentname" , "password" in global sheet.
Reply
#6
Not Solved
Hi,

I tried above script which u post it..
Now I am getting run time error

The Operation cannot be performed..

Why is this So?

Can you please help me...

Thanks
Ashita
Reply
#7
Not Solved
Hello Paul,

When you get resolution for this query. Do reply me.
Thanks
ashita
Reply
#8
Not Solved
(09-01-2011, 03:11 PM)ashita Wrote: [quote='SQT' pid='17856' dateline='1314867201']
Change your script as below:

invokeapplication("C:\ProgramFiles(x86)\MercuryInteractive\QuickTestProfessional\bin\QTPro.exe")
dialog("Login").WinEdit("AgentName").Set DataTable("agentname",dtGlobalSheet)
dialog("Login").WinEdit("Password").Set DataTable("password",dtGlobalSheet)
dialog("Login").WinButton("OK").Click
Wait(1)

Check your column name carefully ,It should be "agentname" , "password" in global sheet.


Hi,

I tried above script which u post it..
Now I am getting run time error

The Operation cannot be performed..

Why is this So?

Can you please help me...

Thanks
Ashita

Hi Ashita and Hi Paul,

Try this below code: It will work 100%

Quote:Invokeapplication("C:\ProgramFiles(x86)\MercuryInteractive\QuickTestProfessional\bin\QTPro.exe")
Dialog("text:=Login").activate
Dialog("text:=Login").WinEdit("attached text:=Agent Name:").set DataTable("agentname",dtGlobalSheet)
Dialog("text:=Login").WinEdit("attached text:=Password:").set DataTable("password",dtGlobalSheet)
Dialog("text:=Login").WinButton("text:=OK").Click
Window("text:=Flight Reservation").WinButton("object class:=Button").WaitProperty "enabled", 0, 500000
Window("text:=Flight Reservation").close

Please do reply guys.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP 11.0 does not record web application shipu 6 6,926 08-03-2014, 01:47 AM
Last Post: riverdiego
  QTP does not record anything on a page developed using AJAX shayk1985 2 2,178 05-21-2014, 04:56 AM
Last Post: shayk1985
  Not able to record web application using qtp 10 in window 7 rashmi_prasad 5 11,059 04-24-2013, 11:23 PM
Last Post: CaptainM
  QTP doesn't record C# application rlin2012 1 2,993 09-11-2012, 12:54 AM
Last Post: freeboynil
  How to record .jnlp app in QTP Alias007 0 3,033 08-26-2012, 03:10 PM
Last Post: Alias007

Forum Jump:


Users browsing this thread: 1 Guest(s)