Popup Watcher cann't push button anymore

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Elena_v
Posts: 4
Joined: Tue Jun 25, 2019 4:27 pm

Popup Watcher cann't push button anymore

Post by Elena_v » Thu Apr 30, 2020 10:44 am

Hello everyone!
I have popup Qt windows in project. I didn't change Repository items and their XPath (100% that they are correct) and PopupWatcher worked good. And now all my Qt buttons cann't be find when tests are running. Ranorex is searching... and after 1 min try to run another code (case). Of course, it isn't possible and tests are stopping as failed :x ! Qtversion='5.12.3'. Example of code here :arrow: :

Code: Select all

void ITestModule.Run()
        {
           //regular code at the beginning...
           
	   var myPopupWatcher = new PopupWatcher();            
            myPopupWatcher.Watch(repo.ToSaveWindow.SelfInfo, ConfirmDialog);
            myPopupWatcher.Start();
            Report.Info("Info", "PopupWatcher started.");
        }        
        public static void ConfirmDialog(Ranorex.Core.Repository.RepoItemInfo repoItemInfo, Ranorex.Core.Element myElement)
        {
	   // To save (QMessageBox) > Button Yes (QPushButton) 
            if (repoItemInfo==repo.ToSaveWindow.SelfInfo)
            {                
                repo.ToSaveWindow.ButtonYes.MoveTo();
                repo.ToSaveWindow.ButtonYes.Click();
                Delay.Seconds(2);
            }
        }
I still cann’t push buttons in PopupWatcher.
:!: This recommendations (from forum) don't work with button element:
.CreateAdapter<Ranorex.Unknown>();
.Focus();
.Click();
.EnsureVisible();
.InvokeMethod();
I can Activate parent element (.Activate();), but buttons I still cann’t push =(
:?: Maybe someone knows another way?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6180
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Popup Watcher cann't push button anymore

Post by odklizec » Thu Apr 30, 2020 11:14 am

Hi,

I'm afraid, it's impossible to tell what's wrong or suggest something without seeing, at very least, a Ranorex snapshot of the problematic element and full xpath (as stored in repository). Ideally, try to create the app snapshot, using Create Snapshot action placed before the typically failing test step.

Also, the popup you want to process with popupwatcher is something that appears regularly or randomly?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Elena_v
Posts: 4
Joined: Tue Jun 25, 2019 4:27 pm

Re: Popup Watcher cann't push button anymore

Post by Elena_v » Thu Apr 30, 2020 1:12 pm

odklizec, thanks for the answer!

Screenshot of problem button in attach. On 4.jpg you can see that Spy is on the left, and Snapshot is on the right side. Interesting thinks: in Snapshot unknown elements appeared (Button 'CommandButton_6' and etc.), but thez aren't exist. :?:
XPath:
QMessageBox is /form[@title~'Подтвердить сохранение в виде' and @windowtext~'Подтвердить сохранение в виде' and @accessiblename='Подтвердить сохранение в виде']
QPushButton is container/?/?/button[@text='&Да' and @accessiblename='Да' and @class~'Button' and @windowtext='&Да' and @flavorname='win32']
I assumed that maybe there are 2 buttons with the same XPath, so I added more parameters to the XPath. Doesn't help.
Attachments
4.jpg
4.jpg (399.04 KiB) Viewed 169 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6180
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Popup Watcher cann't push button anymore

Post by odklizec » Thu Apr 30, 2020 1:24 pm

Hi,

Sadly, screenshot are not very useful here. Please post the snapshots. Apparently, from the screenshot it looks, that the number of elements and overall UI structure is different? Therefore, you must update the xpath accordingly. But as mentioned, it's hard to tell without examining both snapshots (from Spy and from recording).
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Elena_v
Posts: 4
Joined: Tue Jun 25, 2019 4:27 pm

Re: Popup Watcher cann't push button anymore

Post by Elena_v » Mon May 04, 2020 11:13 am

I used git -revert and took …\PopupWatcher\.. from master. PopupWatcher ‘ve started to work, but I have to create changes in it again. :|
Thanks for you answer. Hope that I ‘ll not see this bug anymore.