Hi,
I am trying to test choosing different styles for orders. There are 92 styles in all and they are each separate buttons. I was wondering if there was a way that I could make these buttons into variables since they are all separate repository items. I tried making their paths into variables but that didn't seem to work. Also, I'm not very good at coding so I mostly use Ranorex Recording. Thanks!
Changing buttons into variables
Changing buttons into variables
You do not have the required permissions to view the files attached to this post.
Re: Changing buttons into variables
There are several things you could do, but it depends a lot on what your data looks like. Can you post an example of what data you want to pass into your module to tell it what to select? Is it the model image number ("Model Image - 01"), the img reference hash in the img tag's src property, etc.?
I would guess the model image number. If that is the case, you can do this:
This also depends on what part of the image/icon is clickable. You could add "/a" or "/a/img" if needed.
Also, you could make the variable lookup like this: ".../td[@innertext~'Model\ Image\ \-\ ' + $varModelImageNumber]..." if you just want to pass in "01", "02", etc.
Remember that you can make as many versions of a repo item as you want as long as they have different names, and you and make their paths slightly different. This can allow you to work out what works and what doesn't.
I would guess the model image number. If that is the case, you can do this:
Code: Select all
StyleView => //#'styleView']
..StyleButton => /div/table/tbody/tr/td[@innertext~$varModelImageNumber]/parent::tr/parent::tbody/parent::table/parent::div/div[@class='iconSelect']
Also, you could make the variable lookup like this: ".../td[@innertext~'Model\ Image\ \-\ ' + $varModelImageNumber]..." if you just want to pass in "01", "02", etc.
Remember that you can make as many versions of a repo item as you want as long as they have different names, and you and make their paths slightly different. This can allow you to work out what works and what doesn't.
Shortcuts usually aren't...