Specify browser for Record.module

Ranorex Studio, Spy, Recorder, and Driver.
Lyuba Boerma
Posts: 36
Joined: Mon Apr 01, 2019 12:12 pm

Specify browser for Record.module

Post by Lyuba Boerma » Mon Apr 29, 2019 12:01 pm

Hi!)
I have a test case where i need to do same things in two different browsers.
First steps done in a main browser - Chrome in my case.
and then some of actions need to be done in other browser.

I have a smart folders with IF conditions for a browser.
cond.png
in this folder -3 modules. 2 of them are running with no problem, because they run in a pages different from, what is open in a Chrome now.
When test cames to Recording module : Add new Sample Second Browser. - sometimes i have a problem.

9 in 10 - it runs perfectly
1 in 10 - he jumped back to Chrome browser and contimues there. (More often it happens if my machine has only one monitor)

so...
when test comes to " Add new Sample Second Browser. " i have exactly 2 same pages in different browsers. I can not use Insure visible , because there is no unique elements.
dublicate.png
Differences are only in a browser...and some input fields are empty.
field.png
how can i improve this test case? can i specify a browser for recording module?
maybe there is a way yo use something like "Invoke action: ensure Browser is:" ?

or run it only if input field has no text?


thank you for help.
You do not have the required permissions to view the files attached to this post.

Lyuba Boerma
Posts: 36
Joined: Mon Apr 01, 2019 12:12 pm

Re: Specify browser for Record.module

Post by Lyuba Boerma » Mon Apr 29, 2019 12:05 pm

PS
Sorry i don't know what is going on with screenshots here...But they or disappears or duplicates ....

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

Re: Specify browser for Record.module

Post by odklizec » Mon Apr 29, 2019 12:13 pm

Hi,

If I understand your problem right, there is opened the same page in two or more browsers at the same time? And your problem is, that the actions are performed in incorrect browser?

In this case, I think you should add @processname=$procName or @BrowserName =$browserName to the xpath(s) of your choice and simply fill the process/browser name from data connector, with expected process/broswer name (i.e. iexplore, firefox or chrome). This should help with finding the element you want to manipulate in correct browser. Hope this helps?
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

Lyuba Boerma
Posts: 36
Joined: Mon Apr 01, 2019 12:12 pm

Re: Specify browser for Record.module

Post by Lyuba Boerma » Mon Apr 29, 2019 1:05 pm

Yes) you understood correct.

do you mean that i need to change xpath like this?
/dom[@domain='test.elabjournal.com']//input[#'name'][@browsername=$browser]


It is not working)) he doesnt find element like this (variable is bound)

I also add a snapshot for element, just in case
You do not have the required permissions to view the files attached to this post.

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

Re: Specify browser for Record.module

Post by odklizec » Mon Apr 29, 2019 1:08 pm

No, the xpath must look like this:

Code: Select all

/dom[@domain='test.elabjournal.com' and @browsername=$browser]//input[#'name']
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

Lyuba Boerma
Posts: 36
Joined: Mon Apr 01, 2019 12:12 pm

Re: Specify browser for Record.module

Post by Lyuba Boerma » Mon Apr 29, 2019 1:53 pm

odklizec wrote:
Mon Apr 29, 2019 1:08 pm
No, the xpath must look like this:

Code: Select all

/dom[@domain='test.elabjournal.com' and @browsername=$browser]//input[#'name']
THANK YOU!) It seems working)))