Learning how to write code modules?

Experiences, small talk, and other automation gossip.
Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Learning how to write code modules?

Post by Fergal » Thu Aug 06, 2015 9:57 am

From going through some tutorials, I have a very basic knowledge of C#, e.g. I know how to create loops, use variables and use methods. I know what OOP is, but don't understand it to any level of detail. How can I progress from there to being able to successfully create and use code modules in Ranorex?

Thanks!

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Learning how to write code modules?

Post by Fergal » Wed Aug 12, 2015 3:44 pm

Can someone from Ranorex please give some suggestions on this? Creating and using code modules is something I plan on learning over the coming months - I don't expect to do it overnight.

Thanks!

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

Re: Learning how to write code modules?

Post by odklizec » Thu Aug 13, 2015 9:09 am

Hi Fergal,

Writing code modules is not different from writing user code. So if you are able to write user code, there should not be a problem for you to write code modules? I'm not a programmer either, so I can share my learning experience. Before I started with Ranorex, some 3 years ago, I only heard about C#, but never actually coded anything in it. I had some previous experience with various scripting languages, but that was about it.

In my opinion, the best source of Ranorex coding knowledge is this forum. You can find huge pile of useful code here and this is where I always start digging once I hit a problem. Additionally, the questions posted by fellow members are often great learning material. This is why I'm trying to answer so many posts ;) Not because I have so much spare time, but answering them helps me to improve my general Ranorex skills and also C# coding skills. Many questions were already answered and the answers could easily be found here. Some answers just need a slight modification to meet your demands.

As for general C# coding and samples, there are many nice sources on Internet, like CodeProject, where you can find many great C# examples. It's also good to have a nice C# ebook, like "C# Quick Syntax Reference" by Mikael Olsson or "Fundamentals of Computer Programming with C#" by Nakov, Kolev and co. I'm sure there are many other good or even better books? The thing is, that you don't have to read them from start to end! You just have to open them when you are facing a problem or you miss some basics.

What I unfortunately found least useful for learning coding in Ranorex Studio, is Ranorex API, which is unfortunately not very useful for C# noobs, because of lack of samples. I mean, you can find many samples at Ranorex forum. But if you don't know what exactly you are looking for, it's hard to find it ;) A nice little sample for each API method or property would be really helpful. I fully understand it's hard to have sample for everything, but it can be done. AutoIt help is a great example. This is definitely something Ranorex folks should look at. API in its current form may be useful for hardcore C# coders, but I think even them would like to see some samples for less obvious API methods and properties. Not everything described in API is self-explanatory and even the hardcore users may miss some nice methods, simply because they don't know how to use them? Just my little opinion ;)
Last edited by odklizec on Mon Jan 25, 2016 10:58 am, edited 1 time in total.
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

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Learning how to write code modules?

Post by Fergal » Fri Aug 14, 2015 10:12 am

Thank you very much for your reply Pavel. I appreciate you taking the time to give the benefit of your experience. To date I have only written a very small amount of user code and will take your advice on board for moving forward.

Thanks again!

virender
Posts: 1
Joined: Sun Apr 15, 2018 2:47 pm

Re: Learning how to write code modules?

Post by virender » Thu Apr 19, 2018 7:38 am

Hi,
Am new to ranorex tool, I noticed ITestModule.Run() method which is equivalent to a test case in every code module file, is there any way to add more test cases in the same file. I tried but did not find success.

Do we need to add more and more code module file for every test case?

Also please share how to create Page Object Model in this tool, is this the same way we do in Selenium?

Thanks!