Page 1 of 1

React and Ranorex

Posted: Tue Sep 27, 2016 2:35 pm
by Nono
Hi,

Is it just me or does React objects not applicable to use and test with Ranorex?
React objects are not being identified very well :(

Re: React and Ranorex

Posted: Tue Sep 27, 2016 7:14 pm
by odklizec
Hi,

I'm not familiar with React, but what 'exactly' is your problem? Could you please upload a Ranorex snapshot (not screenshot) of your GUI and a bit more detailed description of your problem?

Re: React and Ranorex

Posted: Wed Sep 28, 2016 11:48 am
by Nono
Hi,

Thank you for your quick reply :)
Basically I get tons of objects in a webpage that are all react objects. They vary only in the unique ID of the react tab, based in the middle of the xpath. I don't think that the dynamic ID blog post we are all familiar with will help in this particular scenario. See snapshot attached as a dropbox link...

Thanks!

https://www.dropbox.com/s/yh8s3e3rw1m52 ... rxsnp?dl=0

Re: React and Ranorex

Posted: Wed Sep 28, 2016 12:18 pm
by odklizec
Hi,

I've checked the snapshot and it looks pretty automatizable to me? I mean, there are many unique IDs with very reasonable names, so there should be no problem automating your app? Additionally, in case there are no IDs, you could use Class strings (or their parts using regexes). You could either add them manually to the recorded xpaths or you can modify the xpath weight so Ranorex recorder will prefer Class attributes over other attributes. A description how to modify the xpath weight can be found in the "dynamic ID" blog post you mentioned ;)

For example, this is the original xpath from snapshot you published (not very reliable xpath):
/dom[@domain='192.168.10.52']//div[#'tabs-Video']/div/div[1]/div[1]/div/div[1]/div[2]/div[2]/div/span
And this is what you get if you change the xpath weight of webelement >> class attribute to 100:
/dom[@domain='192.168.10.52']//div[#'tabs-Video']/div/div[@class='publish-main export columnMiddle']/div[1]/div/div[@class='settings_part']/div[2]/div[@class='editboxWrapper']/div/span
And after some quick manual editing, you can get something like this:
/dom[@domain='192.168.10.52']//div[#'tabs-Video']/div/div[@class='publish-main export columnMiddle']//div[@class='settings_part']/div/div[@class='editboxWrapper']/div[@class='input_icon clear']/span
This is much better xpath, don't you think? ;)