System tests on BrowserStack

Ask general questions here.
jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

System tests on BrowserStack

Post by jsmith » Thu Oct 11, 2018 11:44 am

I can create a test using Ranorex that goes to our site and completes an end to end test. I need to run the same test on lots of different browsers, and over lots of possible devices. This has led me to look at BrowserStack. It looks to me like if I want to use BrowserStack, I need to rewrite all my tests, and importantly, they need to be properly coded using Selenium or something like it. In other words, my organisation needs to move away from Ranorex because Ranorex can't be used with BrowserStack.
So, am I right in my assumptions here?
I want to push my ranorex test to browserstack and have BS run my RX tests across all different browsers and devices.
Is this possible?
Is it ever going to be possible?

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

Re: System tests on BrowserStack

Post by odklizec » Thu Oct 11, 2018 12:00 pm

Hi,
jsmith wrote:
Thu Oct 11, 2018 11:44 am
It looks to me like if I want to use BrowserStack, I need to rewrite all my tests, and importantly, they need to be properly coded using Selenium or something like it. In other words, my organisation needs to move away from Ranorex because Ranorex can't be used with BrowserStack.
So, am I right in my assumptions here?
No, you definitely don't have to rewrite your tests with selenium. Ranorex is already able to run its tests on the cloud services like BS. All you need to do is to connect to BS via Ranorex endpoint. I would suggest you to start here:
https://www.ranorex.com/help/latest/web ... g-started/
Check also this post:
settings-for-webdriver-endpoint-browser ... 10918.html
The only problem could be if your tests are using native web browser dialogs, which are not supported by Selenium. Therefore, it's not possible to run Ranorex steps featuring native browser dialogs (like login or download forms) via endpoint.
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

jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

Re: System tests on BrowserStack

Post by jsmith » Thu Oct 11, 2018 2:11 pm

Thank you for your encouraging reply. To clarify, none of my tests are currently written in selenium, they were created using Recorder. I am now going to look at the links you have listed, and see if I can connect even one test to BS and see it running....

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

Re: System tests on BrowserStack

Post by odklizec » Thu Oct 11, 2018 3:05 pm

jsmith wrote:
Thu Oct 11, 2018 2:11 pm
To clarify, none of my tests are currently written in selenium, they were created using Recorder.
This is perfectly OK. The beauty of Ranorex is, that it allows to run its tests on selenium webdriver, without the need to write a single line of selenium code ;)
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

jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

Re: System tests on BrowserStack

Post by jsmith » Mon Oct 15, 2018 11:48 am

Hello again,
I have successfully created an Browserstack Automate endpoint, by entering the end point url as http://hub-cloud.browserstack.com/wd/hub/

I have added the following json configuration:

{
"browserstack.user": "****",
"browserstack.key": "****",
"platform": "macOS 10.12",
"browserName": "safari",
"version": "10.0"
}

The endpoint states it is connected. I have set the endpoint as automation root. When I click run, it looks to me like the test is running locally.
I have read the links above, but cannot find any more clues as to how to make this work. Can you provide a link to more detailed and specific instructions? Have any other users tried to connect BS and RX, and how did you do it?

jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

Re: System tests on BrowserStack

Post by jsmith » Mon Oct 15, 2018 12:01 pm

I might have spoken too soon, limited success! The test failed stating that the json property should be MAC, not macOS. Test did connect to BS, and ran once corrected. Exciting times!

jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

Re: System tests on BrowserStack

Post by jsmith » Fri Oct 19, 2018 5:02 pm

Well, after a couple of days I have made good progress in some areas and hit annoying problems in others.
Through Ranorex(RX), I can now push my RX recorded tests to BrowserStack(BS). I have a simple logon test that takes about 60 seconds.
I have set up separate endpoints for each of the different browsers so that I may change between them using User Code.
I take screenshots of the BS browser, and get these back to my machine easily for visual regression testing, which seems to be going well.

My main problem at present surrounds Safari. Somehow, the first button that needs to be pressed is not found on Safari, despite being found perfectly on Windows various browsers. The path of the element is

Code: Select all

.//button[#'login-box__next']
The element before this is a text box with the path:

Code: Select all

.//input[#'login-box__email']
Hopefully you can see the similarity. I am pulling my hair out. Why oh why can Safari, BS or RX not see this element?
The element is found perfectly locally, and through windows...
Any thoughts or suggestions would be much appreciated.

User avatar
qwertzu
Posts: 284
Joined: Wed Jan 25, 2017 11:08 am

Re: System tests on BrowserStack

Post by qwertzu » Mon Oct 22, 2018 1:21 pm

hey,

It could be that the path is slightly different in Safari.
Have you already tried to run the test in maintenance mode? as soon as the element can't be found, Ranorex will pause the test and you will be able to see what path the element actually has during the test run.
this will help you adapt the path in a way that the element will also be found in Safari.

regards, qwertzu

jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

Re: System tests on BrowserStack

Post by jsmith » Tue Oct 23, 2018 10:18 am

Hi qwertzu,
No luck I'm afraid. Maintenance mode made no difference upon test failure, I just got the report back as normal.
I can progress from the login screen by doing a Key Press {Return} on the email address stage, but of course this is a workaround, it doesn't solve (or identify) the root problem.

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

Re: System tests on BrowserStack

Post by odklizec » Tue Oct 23, 2018 11:22 am

Hi,

I think you will have to examine the problematic element directly on the BrowserStack machine, with some kind of developer tools (if available in Safari)? Or at very least, examine page's source code. Either the ID is different, not used or the element has a different name? Try to use 'buttontag' instead of just 'button'. Or replace 'button' with '*'.
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

jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

Re: System tests on BrowserStack

Post by jsmith » Tue Oct 23, 2018 1:09 pm

Hi odklizec,
I have looked at the dev tools through the BS Interactive mode, and confirmed the element ID is the same. The button goes from disabled to enabled when I input an email. Could this cause the browser to not identify the button?

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

Re: System tests on BrowserStack

Post by odklizec » Tue Oct 23, 2018 1:18 pm

jsmith wrote:
Tue Oct 23, 2018 1:09 pm
The button goes from disabled to enabled when I input an email. Could this cause the browser to not identify the button?
I don't have a clue. But I would expect such kind of problem only if the xpath contains [@enabled=true]? I'm afraid, that if none of the suggestions helped, the best you can probably do is to request help from Ranorex support (here)?
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

jsmith
Posts: 36
Joined: Mon Mar 05, 2018 4:03 pm

Re: System tests on BrowserStack

Post by jsmith » Fri Nov 02, 2018 4:37 pm

This was solved by using a Key Sequence {Return} on the box that it could find. Still a frustrating problem, but whilst this workaround works, it will have to do.