Converting to user code generates wrong code

Bug reports.
Sae1962
Posts: 15
Joined: Tue Feb 06, 2018 4:25 pm

Converting to user code generates wrong code

Post by Sae1962 » Wed Feb 07, 2018 11:47 am

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
You do not have the required permissions to view the files attached to this post.

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

Re: Converting to user code generates wrong code

Post by odklizec » Thu Feb 08, 2018 10:19 am

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?
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

Sae1962
Posts: 15
Joined: Tue Feb 06, 2018 4:25 pm

Re: Converting to user code generates wrong code

Post by Sae1962 » Thu Feb 08, 2018 10:24 am

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.

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

Re: Converting to user code generates wrong code

Post by odklizec » Thu Feb 08, 2018 11:21 am

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.
You do not have the required permissions to view the files attached to this post.
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