How to make QTP ignoring changing window title? - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: General (https://www.learnqtp.com/forums/Forum-General) +--- Forum: Posting Guidelines/Disclaimer (https://www.learnqtp.com/forums/Forum-Posting-Guidelines-Disclaimer) +--- Thread: How to make QTP ignoring changing window title? (/Thread-How-to-make-QTP-ignoring-changing-window-title) |
How to make QTP ignoring changing window title? - Lachsi - 01-23-2012 Hey there, I am evaluating QTP if it's more useful for us (Bosch) than TOSCA Tricentis. Right now, I am encountering following problem: I'm automating a Software, the Window of this Software is called "FSA 050 / 500". This program starts with a list of a whole bunch of submenus, where the window will switch by entering them by pressing the F12. SwfWindow("FSA 050 / 500").SwfWindow("TP_Start").SwfTreeView("m_oTreeView").Select 50 SwfWindow("FSA 050 / 500").SwfWindow("TP_Start").SwfButton("F12").Click When I enter the submenu in index 50 as example, the window title will expand from "FSA 050 / 500" to "FSA 050 / 500 - Universal oscilloscope 2 channel" and that's some serious issue! The question ist: how can I teach QTP, that it shall use the window title "FSA 050 / 500" and ignoring everything else behind? I've tried regular expressions, but failed. Somehow, and I really don't know why, QTP worked as I wished for. I've entered the submenu and QTP recorded those controls still under "FSA 050 / 500" -> SwfWindow("FSA 050 / 500").SwfWindow("C_MultiScope").SwfEditor("m_oInfoBox_2").Check CheckPoint("m_oInfoBox_5") SwfWindow("FSA 050 / 500").SwfWindow("C_MultiScope").SwfButton("F12").Click Unfortunately, it now looks like: SwfWindow("FSA 050 / 500 - Universal oscilloscope 2 channel").SwfWindow("C_MultiScope").SwfEditor("m_oInfoBox_2").Check CheckPoint("m_oInfoBox_5") SwfWindow("FSA 050 / 500 - Universal oscilloscope 2 channel").SwfWindow("C_MultiScope").SwfButton("F12"). Has someone a clue? Sometimes it works as wished, sometimes not. It was always only the .NET addin loaded. Thanks! RE: How to make QTP ignoring changing window title? - Anil - 01-24-2012 (01-23-2012, 09:00 PM)Lachsi Wrote: Hey there, Use Regular expression for title and try SwfWindow("FSA 050 / 500.*").SwfWindow("C_MultiScope").SwfEditor("m_oInfoBox_2").Check CheckPoint("m_oInfoBox_5") RE: How to make QTP ignoring changing window title? - Lachsi - 01-25-2012 The problem is that QTP refers sometimes to the objects in SwfWindow("FSA 050 / 500") and sometimes to the objects in SwfWindow("FSA 050 / 500 - Universal oscilloscope 2 channel"). If I use regular expression, that wouldn't solve the problem, that QTP shall refer to only one object instead of two. As example this program has a bar on the bottom with buttons. QTP recognizes this bar sometimes in both menus as ONE and the same object in the repository, sometimes it creates the same object type just in another directory - in this case SwfWindow("FSA 050 / 500 - Universal oscilloscope 2 channel"). As consequence, I have two objects for one control. And well, sometimes not. This behaviour makes it impossible to create safe test cases. (01-24-2012, 12:41 PM)Anil Wrote:(01-23-2012, 09:00 PM)Lachsi Wrote: Hey there, |