OK button on popup not reacting in replay

Mobile Testing, Android App Testing.
User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

OK button on popup not reacting in replay

Post by FelixK98 » Thu Apr 21, 2016 6:38 am

Hi Everyone,

I am getting strange error in report for Touch action of button:
Run_Error.PNG
Error within report
Run_Error.PNG (11.22 KiB) Viewed 778 times
I got hybrid app running in iPod with iOS 9.3.1
When I tracking element with Spy I am getting the following data:
Ranorex_Spy_result.PNG
Spy screen with element recognition path
Ranorex_Spy_result.PNG (130.48 KiB) Viewed 775 times
Any suggestions to how make it work properly are very welcome.

Thanks,
Felix.

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

Re: OK button on popup not reacting in replay

Post by odklizec » Thu Apr 21, 2016 7:10 am

Hi Felix,

Are you sure the xpath returned by Spy is exactly the same as the one stored in repository? I would suggest to remove the index [3] behind the DIV, but make sure, the xpath without index is still valid and returns correct element! Eventually, try to find a reasonable attribute that could be used instead of the index number. Indexes are often changing and so you should use them only as a last resort.
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

User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

Re: OK button on popup not reacting in replay

Post by FelixK98 » Thu Apr 21, 2016 7:49 am

Hi odklizec,

Thanks for suggestion.
I tried to use it without index after "div" and it recognizable by Spy and during replay. But I am getting same error within report and popup does not closing.

Thanks,
Felix.

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

Re: OK button on popup not reacting in replay

Post by odklizec » Thu Apr 21, 2016 8:30 am

Sorry, my mistake. I overlooked you experiencing a problem with adapter type and not the element identification ;)

OK, please try to change the Adapter Type of the problematic element (in repository), as described here:
http://www.ranorex.com/forum/difficulty ... tml#p29884
If I understand it right, the problematic button is an HTML element? So try to change the Adapter Type to 'webelement'.

BTW, I'm surprised that the element got recognized in embedded HTML. I was under the impression that the HTML pages (on iOS) could be tested only via RxBrowser? In other words, that the HTML elements in embedded browser cannot be recognized at all?
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

User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

Re: OK button on popup not reacting in replay

Post by FelixK98 » Fri Apr 22, 2016 2:23 am

Hi odklizec,

I looked in element property and it doesn't have any adapter type rather then default:
screenshot_20160422_001.png
Element property
screenshot_20160422_001.png (8.05 KiB) Viewed 760 times
Our App is hybrid app or in other word it is wrap of browser within some sort of overlay of scanner app which provide communication with scanner hardware.

Thanks
Felix.

User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

Re: OK button on popup not reacting in replay

Post by FelixK98 » Fri Apr 22, 2016 6:05 am

Hi,

One extra question.
Is it possible to set Adapter type for repository item in code on-flight?

Thanks
Felix.

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

Re: OK button on popup not reacting in replay

Post by odklizec » Fri Apr 22, 2016 7:22 am

Hi,

You can try to this code to create a WebElement adapter from repo iteminfo element...

Code: Select all

public void CreateAdapter(Core.Repository.RepoItemInfo repoInfoElement)
{
    Ranorex.WebElement webElementAdapter = repoInfoElement.CreateAdapter<Ranorex.WebElement >(true);
}
However, if there is no WebElement available in the list of available Adapter types (for given repo element), then it will most probably not work either. I think your best option is to contact Ranorex support ([email protected]) and provide them with our application, so they can debug it.
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

User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

Re: OK button on popup not reacting in replay

Post by FelixK98 » Tue Apr 26, 2016 7:34 am

Hi Everyone,

I can show an example of code which is used for our dialog and problem button:

Code: Select all

 <dialog class="mdl-dialog">
    <h4 class="mdl-dialog__title">Allow data collection?</h4>
    <div class="mdl-dialog__content">
      <p>
        Allowing us to collect data will let us get you the information you want faster.
      </p>
    </div>
    <div class="mdl-dialog__actions">
      <button type="button" class="mdl-button">Agree</button>
      <button type="button" class="mdl-button close">Disagree</button>
    </div>
  </dialog>
  <script>
    var dialog = document.querySelector('dialog');
    var showDialogButton = document.querySelector('#show-dialog');
    if (! dialog.showModal) {
      dialogPolyfill.registerDialog(dialog);
    }
    showDialogButton.addEventListener('click', function() {
      dialog.showModal();
    });
    dialog.querySelector('.close').addEventListener('click', function() {
      dialog.close();
    });
  </script>
The difference is that we using one button instead two.
So, when test comes to touch button it does make a touch, but dialog not closing.
My guess is that javascript does not catch close event.
I wondering if someone can help me to solve this.

Thanks,
Felix.

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

Re: OK button on popup not reacting in replay

Post by odklizec » Tue Apr 26, 2016 9:07 am

Hi Felix,

I'm afraid, I'm out of ideas here. I think your problem has something to do with the fact it's hybrid app with integrated web page? I would suggest you to contact directly Ricoh support ([email protected]) and provide them with your app, so they can test it and suggest a solution/workaround, if there is any?
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

User avatar
FelixK98
Posts: 54
Joined: Fri Apr 08, 2016 6:28 am

Re: OK button on popup not reacting in replay

Post by FelixK98 » Wed Apr 27, 2016 3:05 am

Hi Everyone,

I resolved my problem with OK button.
The solution was so easy that I couldn't believe at first moment that this works. :oops:
I used function PerformClick() instead of Touch() and it works for me.
Possibly it is happened because we used "Material Design Lite" framework for app UI which is made for desktop web applications as well as for mobile hybrid apps.

Thanks,
Felix.