Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make QTP ignoring changing window title?
#1
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!
Reply
#2
(01-23-2012, 09:00 PM)Lachsi Wrote: 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!

Use Regular expression for title and try
SwfWindow("FSA 050 / 500.*").SwfWindow("C_MultiScope").SwfEditor("m_oInfoBox_2").Check CheckPoint("m_oInfoBox_5")

Reply
#3
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,

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!

Use Regular expression for title and try
SwfWindow("FSA 050 / 500.*").SwfWindow("C_MultiScope").SwfEditor("m_oInfoBox_2").Check CheckPoint("m_oInfoBox_5")

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to check the changing value of each iteration parikhtapan 0 1,819 04-06-2012, 11:44 PM
Last Post: parikhtapan

Forum Jump:


Users browsing this thread: 1 Guest(s)