Develop using code

Ask general questions here.
satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

Develop using code

Post by satishmohan » Tue Nov 10, 2015 11:51 am

Hi. Till now I was using Ranorex just to record and play. Now want to understand how the flow happens at the code level. May be start off with simple Test case like login-logout. Please suggest when i record this scenario, how do and where do i start to understand the code generated behind.

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

Re: Develop using code

Post by odklizec » Tue Nov 10, 2015 12:29 pm

Hi,

The easiest way to understand the code behind each action is to right click the recorded action and from the appeared menu select "View Code" (or use Ctrl + Enter shortcut). The code you will see is non-editable! It's auto-generated code and cannot be manually changed. The only way how to edit this code is to convert the selected action (or multiple actions) to User Code action (also via right click menu).

A good thing is to use breakpoints here or there, to watch the code flow and eventually continue with playback "step by step" using F11 shortcut (or similar debug shortcuts...see actions in menu Debug).
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

satishmohan
Posts: 56
Joined: Wed Jun 10, 2015 4:35 pm

Re: Develop using code

Post by satishmohan » Mon Dec 21, 2015 3:54 pm

Hi. Attempted using right click - convert to user code. Then introduced a simple for loop to execute the whole test case (login-logout) to run in iterations (4 times). it give an error that there were compile errors. Please suggest.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Develop using code

Post by krstcs » Mon Dec 21, 2015 4:46 pm

Without more information it will be hard to suggest anything...

Ranorex version?
Windows version?
EXACT error message(s)?

Please post the code being used.
Shortcuts usually aren't...