I am wondering if this is possible. What I am trying to do is specify a column in an Excel spreadsheet corresponding to repository elements, and then using a variable bound to this data source, run Click() events iteratively. As an example, I've captured several buttons from Calc.exe to the repository. I've created an Excel spreadsheet with a column called excel_buttonClick that lists these buttons:
EXCEL_BUTTONCLICK
repo.Calculator.Calc.Button131
repo.Calculator.Calc.Button132
and so on. My module contains a variable called varButton, which is bound to that column. The usercode is simply:
Mouse.Click(varButton);
When I try and run this, I get an error reported that 'no element found for path 'repo.calculator...' etc. However, if I instead change the Excel column to the corresponding paths:
EXCEL_BUTTONCLICK
/form[@title='Calculator']/?/?/container[@instance='1']/button[@controlid='131']
/form[@title='Calculator']/?/?/container[@instance='1']/button[@controlid='132']
it works fine. It's certainly not the worst solution, but I was hoping to pass the repo-style info using Excel, because a) the element names will remain the same even if the XPath changes, and b) the element name is more human-readable usually than the XPath. Any info or guidance would be appreciated. Thanks!
trying to pass in repo element from Excel for click event
Re: trying to pass in repo element from Excel for click event
I'm afraid, passing repo elements using Excel (or via parameters to user code/functions) is currently not possible. See these posts:
http://www.ranorex.com/forum/pass-repos ... tml#p23679
http://www.ranorex.com/forum/pass-repos ... t4893.html
http://www.ranorex.com/forum/pass-repos ... tml#p23679
http://www.ranorex.com/forum/pass-repos ... t4893.html
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: trying to pass in repo element from Excel for click event
Thanks for your reply. Not a huge deal; since using the XPath works fine, that's how I'll proceed.