How to find more than one application(AUT) instances are opened. - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: How to find more than one application(AUT) instances are opened. (/Thread-How-to-find-more-than-one-application-AUT-instances-are-opened) |
How to find more than one application(AUT) instances are opened. - dineshb - 08-06-2010 Hi, During test batch execution the application is not closed,then it remains opened & second instance of the application invoked. Therefore multiple instances may be opened & batch execution fails. Is there any way in QTP to find the total no. of "Application Under Test" instances are opened? I know how to close the multiple instances. Use following command for it. SystemUtil.CloseProcessByName("Notepad.exe") Thanks in advance. Dinesh RE: How to find more than one application(AUT) instances are opened. - venkatbatchu - 08-06-2010 Hi, If your application is web based application: Code: OnErrorResumeNext Please let me know for further clarification. RE: How to find more than one application(AUT) instances are opened. - lotos - 09-16-2010 Try this: Code: Public Function RunBrowser The function will check if in any browser exists the URL on which you are working(if it was not being closed), and will close it, after that will run again the browser with URL you need to be run. To run your browser, call the method within first action as next: Code: 'calling the RunBrowser function or, you can remove the "SystemUtil.Run "iexplore.exe", "http://yahoo.com" line from the function and rename the function for e.g. as CloseAllMyURLs, and call it at the end of all your tests - it will check if your browser with your URL is closed: Code: 'calling the CloseAllMyURLs function OR you can try this method at the end of each test: Code: Public Function CloseBrowser |