Extract data from test and use it in another test - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Extract data from test and use it in another test (/Thread-Extract-data-from-test-and-use-it-in-another-test) |
Extract data from test and use it in another test - yuetling926 - 10-06-2009 Hi All, Can I use the "output value" to output text form one test and use it in another test? Thanks Jody RE: Extract data from test and use it in another test - Saket - 10-06-2009 No, you cant do this directly, you will have to put this into output parameter of one test and take it into the input parameter of another test. or you can set the value in data table and use it. RE: Extract data from test and use it in another test - yuetling926 - 10-06-2009 However, I am using a function to generate a string in test1 and want to use that string in test 2. It is assumed that I don't need to remember the generated string and can ne used in test 2. Input parameter can also achieve it? Thanks Jody RE: Extract data from test and use it in another test - Saket - 10-06-2009 Yes, the returned string from your function in test1 should go in the Output parameter for test1 and use the O/P parameter of test1 as input parameter for test2. RE: Extract data from test and use it in another test - yuetling926 - 10-06-2009 Can it really transfer to another Test file? it seems that output values from test1 and only be used later within only test1. it is because it stored the output value in a globalsheet. However, when I open Test2,,the value in global files become blank. Then, how can I make it as a input parameter of test 2? Thanks Jody RE: Extract data from test and use it in another test - Saket - 10-06-2009 oh sorry, my mistake. I assumed you are calling tests in an script. this is not possible if these are two seperate scripts unless you call the scripts through a vbscript. RE: Extract data from test and use it in another test - basanth27 - 10-06-2009 Write the output from test1 to a excel or filesystemobject. For Test2 read value from the excel data. Does this help ? RE: Extract data from test and use it in another test - Saket - 10-06-2009 if you are using QTP AOM then you can easily do this see if the code below gives you an idea Code: Set qtApp = CreateObject("QuickTest.Application") missed to assign ouput parameter to the input parameter for second run in the code try this - Code: Set qtApp = CreateObject("QuickTest.Application") RE: Extract data from test and use it in another test - Tharun007 - 06-30-2011 Hey Saket, Can you give me an example (simple one) for the output parameter of one test and take it into the input parameter of another test.?? RE: Extract data from test and use it in another test - Archens - 04-26-2012 Quick-and-dirty alternate method using Windows environment variables: Code: Sub SetSysEnv(strSysEnvVar,strValue) Archens |