Coding in Ranorex

Ask general questions here.
bowang616
Posts: 3
Joined: Tue May 22, 2018 10:12 pm

Coding in Ranorex

Post by bowang616 » Wed May 23, 2018 3:13 pm

Hello,

I am new to Ranorex and would like to know if it is possible to automate tests for web applications fully by coding. I understand there are tools like Recorder and Spy to help you identify elements and other things, but I am used to coding and have done automation coding in Java/Python using Selenium WebDriver, so I am wondering if Ranorex allows you to automate tests completely in C# without Recorder and Spy.

If yes, how does it compare to coding in Selenium? Is it very different or similar? Also is it recommended and easier to identify/maintain elements using the Spy?

Any other information is greatly appreciated.

Thank you.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Coding in Ranorex

Post by Support Team » Wed May 23, 2018 8:56 pm

Hi Bowang616,

I may be a little biased but I do have a Selenium background and can provide some helpful information. With Ranorex, you can 100% use only code and we have many customers who do this - but I often don't recommend it. All actions in a Recording Module are 100% c#/VB.NET code in the background which you can view and edit yourself if needed. The recording module is basically writing the code for you and is displaying a manageable "beautified" version of the code. Recording modules are much easier to maintain and understand (great for passing your project on or when adding new team members). I recommend giving recording modules a shot, they will likely exceed your expectations.

Nonetheless, you still have the choice to work fully in code. With Ranorex, you can use an API that is much easier than Selenium. You can continue to use the Ranorex Repository in code and even drag & drop elements from the repository to your code. Ranorex will refactor your code automatically when making updates to elements to your centralized repository.

Ranorex Spy is one of our core tools and blows many of the selenium object pathing tools away. Coming from Selenium, you will be able to quickly adapt to our element pathing syntax - RanorexPath (or RxPath for short). This is essentially XPath, but with 10+ years of improvements. Note, your objects are mapped/stored in a Ranorex Repository, Spy is for creating/modifying the RxPath to the elements.

Here are a few links that go into more detail on some of these points that you may find helpful: All of the above is just the tip of the iceberg and there are a ton of other great features that I did not mention. If you have any specific questions, please let me know as I will be more than happy to help!

Cheers,
Ned (Support Engineer)
.
Image

bowang616
Posts: 3
Joined: Tue May 22, 2018 10:12 pm

Re: Coding in Ranorex

Post by bowang616 » Wed May 23, 2018 9:53 pm

Thanks Ned for the reply.

I have been playing with the Recorder, and what I'm understanding so far is that I can record actions, and behind each action there is source code in the background doing all the work, and I can modify the code to have this action make additional decisions if needed. During recording, Ranorex also identifies a path for each element and stores it in the repository, which can be seen by other actions. The Spy tool can also identify elements using RxPath and store them in repository for other actions to use. Then you can record more actions, and they become modules, which build up my test suite.

Am I on the right path understanding how Ranorex works?

I guess there is no reason to code from scratch to automate tests since Ranorex does most of the dirty work for you and allows you to modify the code to do what is needed. I'm just used to coding in Selenium and organizing the tests in code, and using inspector tool to find elements, so the things that Ranorex offer are fairly new to me. They do look very attractive so far.

Thank you.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Coding in Ranorex

Post by Support Team » Thu May 24, 2018 8:20 pm

Hi Bowang616,

I am happy to hear I was able to help. You are on the right path and have a correct understanding of many of the core designs of Ranorex. There is a little bit of a learning curve as there is with any new tool, but once you get the hang of it, you will never want to look back! We have a ton of great resources you can use to expand your knowledge, such as our User Guide, Blog, and Live & On-Demand webinars. If you get stuck on something or have any more questions, please do not hesitate to let us know!

Cheers,
Ned
.
Image