![]() |
How do you Change Run mode mid script? - 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: How do you Change Run mode mid script? (/Thread-How-do-you-Change-Run-mode-mid-script) |
How do you Change Run mode mid script? - Caleytown - 03-10-2009 I have been trying to figure out how to change the delay between steps mid run. I currently have a script that has two parts, the first part can be run in "Fast" mode, needing little to no delay between steps. The second part of the test needs to be run much slower, with a second between each step. Is there a function that will change the RunMode part way through the script? If this is not possible, the other possibility is carrying over an array of strings over from one action to another, but I haven't had much luck getting that to happen either. Any Ideas? Thank. RE: How do you Change Run mode mid script? - MVChowdary - 03-10-2009 Hi Caleytown, After executed first part call this function in VBS file,Can change the Runmode like you want execute the Normal or fast mode. Code: Set App = CreateObject("QuickTest.Application") Thanks ---------------------------------------------- RE: How do you Change Run mode mid script? - Caleytown - 03-10-2009 Well, that kinda worked. It changed the RunMode to normal after the action was fully executed, but I need it to change the RunMode half way through the action. Is there a way to do that? Thanks RE: How do you Change Run mode mid script? - tarunlalwani - 03-11-2009 Nope, The only way to do it is to split your actions. Reason being these settings are only read when a newscope is created and that only happens when you run a action. In case you want to use the same Action only then you can try adding 2 iterations where in iteration 1 only fast code runs and in iteration 2 the slow code runs. RE: How do you Change Run mode mid script? - Caleytown - 03-12-2009 The problem is the first part of the test pulls data from a spread sheet and stores in an array( This happens in a big FOR loop and takes forever with a 1 sec delay). Then the second part of the test uses the array. How do I carry over that array from one action too another if I split the action? RE: How do you Change Run mode mid script? - tarunlalwani - 03-12-2009 You can declare that variable in a Library file and then associated that library file with the test. Code: 'In lib RE: How do you Change Run mode mid script? - RB26578 - 03-25-2021 I realize this thread is old but this may be useful to someone in the future. Here is a walkthrough someone did and is how I solved this issue.... https ://subscription.packtpub.com/book/application_development/9781849688406/1/ch01lvl1sec20/using-a-global-dictionary-for-fast-shared-data-access Essential I moved my long looping process to a .vbs file & associated in the test within the functional library. For me, the .vbs file builds a dictionary that is used later in the script. Previously this would take 1min+ to build the dictionary during the test in Normal Run mode. Now the dictionary is initialized & built at the beginning of the test in a split second. Note: I moved the Dictionary.add function from the UFT Action into the InitializeDictionary function Code: '-=== myGlobals.vbs ===- |