Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Transfer of unique data from one script to another
#1
Not Solved
Hi there,

I have been given the task of revieweing QTP as a test tool that will help with regression and so I have been having a play and am very impressed with the ease of use the tool allows.

I have a couple of questions in regards to the recording and playback options and so am hoping you guys might be able to help me out!

Let me explain the process I am recording and what I want QTP to do:

Script 1 - I record a user populating data fields in a form. This form is backed by an entity in the database which is automatically assigned an id e.g. 123456.

Script 2 - I record another user signing in, locating the entity id from a list, clicking on its URL (which has id 123456 as a parameter). This then opens the form so the user can continue filling in the form before submitting it

The above is only part of the end to end process that I want to be able to playback, however it hopefully gives a general understanding of what is going on.

As I have stated every time this process is ran a unique incremented id is generated for the entity used by the form. However this causes issues when doing playback as this number will have already be assigned etc etc. So what I need is a way round this, so when I do a playback of this script, the id that is generated at the start of the process is captured (using an output value?) and then transfered to the next script so the whole process can run from end to end and anywhere the orignal recorded id is displayed within the scripts will be over wrriten by the new id. Is this at all possible?

Also, how is it possible to dynamically find a URL in a page containing the above ID and then click it.

Or alternatively, is it possible to always select the last link displayed in a table on the web page? My entity is always displayed at the bottom of a table once it has been created.

Regards

GOM
Reply
#2
Not Solved
Sure, all what you have described above can be achieved.

Run time Capture - If you intend to use the id no in the same run session you can go for Environment variables/OutPut Values/ or simply capture it into the run time data table.
If you intend to use the id no generated in one session into another run session then you may go for capturing the value into a txt file. The txt file creation, opening, reading, writing can all be achieved by FSO (FileSystemObject Model)

is it possible to dynamically find a URL in a page containing the above ID and then click it - Yes. Use child objects and using a looping structure, try to find the required value using instr function. Once found you can click on it.

is it possible to always select the last link displayed in a table on the web page? -
Find the no of rows in the webtable at run time using object.RowCount
Using ChildItems method, click on the required link

Hope it helps!
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
Thanks for the speedy response!

From the methods you have described, do the commands etc have to be written by hand?

Unfortunately I do not yet have the knowledge to write scripts manually within QTP so is it possible to create the methods decribed using the toolbar options etc?

Regards

GOM
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Web Object Unique ID Number zunebuggy 0 1,560 07-10-2017, 05:37 PM
Last Post: zunebuggy
  On Saving Script in QTP 11 my Global Data Sheet data is removed M Adnan Iftikhar 0 2,177 06-02-2015, 09:19 PM
Last Post: M Adnan Iftikhar
Rolleyes QTP Unique Identification of object minug 11 12,938 02-26-2014, 12:39 PM
Last Post: supputuri
  getting data from global data sheet and using it in the same script jbelkin@gmail.com 1 16,002 07-31-2012, 11:59 AM
Last Post: Ankesh
  Data Table Cells Locked in QTP 11 when script is saved to QC anil2u 1 3,392 05-18-2012, 06:25 PM
Last Post: Shridevi.Salagare

Forum Jump:


Users browsing this thread: 1 Guest(s)