Page 1 of 1

Converting to user code generates wrong code

Posted: Wed Feb 07, 2018 11:47 am
by Sae1962
Hello!

I created a recording with Ranorex Studio & a second one by copying the first recording, where both run identically and fine. Converting the second recording to user code creates a semantically wrong code so that the last click incorrect. The error is easily reproducible.
  • Open Ranorex Studio
  • Create a new project by clicking on "New solution" or File > New > Solution…
  • Press the menu button [Add recording module]
  • Press the [RECORD] button in the new recording module
  • Chose the "Web" technology
  • Select Google Chrome as your browser & enter the IP address of IVM (dot) at.
  • Click on the "Jobsite" link in the orange menu
  • Under the line "Wir suchen Sie für ...", please enter the word "Softwareentwickler".
  • Below the line "Region eingrenzen:", please click on one region (one of the Austrian states)
  • Click on the link "Öffnen" below.
  • Stop the recording & try whether it works. (It will.)
  • Mark all the steps in the recording & copy it to the clipboard
  • Create a second recording & paste all the steps from the clipboard
  • Run the second recording to see, whether it works properly. (It will.)
  • Now, select all the steps in the second recording
  • Click on the selection the right mouse button
  • Select 'Convert to user code'
  • Now, run the second recording again.
The modified second recording will go to the uppermost left location, which is the recycle bin in my OS, and it will not click on the link "Öffnen".

.NET runtime version (Ranorex): 4.0.30319.42000
Google Chrome version 64.0.3282.140 (official build) (64 bit)
OS: Windows 10 version 10.0.16299 build 16299
Ranorex version: 8.0.0+git.6b58189a

Re: Converting to user code generates wrong code

Posted: Thu Feb 08, 2018 10:19 am
by odklizec
Hi,

Could you please upload (via public file sharing service) your test project? I've checked the steps you mentioned, but there seems to be no "Öffnen" link available anywhere on the page (after selecting the region). Where exactly the link should appear?

Re: Converting to user code generates wrong code

Posted: Thu Feb 08, 2018 10:24 am
by Sae1962
Sorry for that. You should first add some jobs to your job cart. Only after that, it is possible to open it (i.e. "Öffnen" becomes visible). This is an error in my test case, as the test should first add something to the job cart for the case that it is empty.

Re: Converting to user code generates wrong code

Posted: Thu Feb 08, 2018 11:21 am
by odklizec
Unfortunately, without seeing your project, it's impossible to tell what's wrong. My quick test works exactly the same both with recorded and converted steps? So my guess is, that you have hardcoded the xpath to "+" button (first one?) and so if you run your test second time (with coded steps), the test actually clicks "minus" button and so the Öffnen link disappears? Anyway, check the xpaths in my sample, which should give you a clue how to click first available "plus" button.