trying to pass in repo element from Excel for click event

Ask general questions here.
hnporter
Posts: 18
Joined: Thu Jan 16, 2014 3:34 pm

trying to pass in repo element from Excel for click event

Post by hnporter » Mon Jan 27, 2014 3:06 pm

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!

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

Re: trying to pass in repo element from Excel for click event

Post by odklizec » Mon Jan 27, 2014 3:15 pm

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

hnporter
Posts: 18
Joined: Thu Jan 16, 2014 3:34 pm

Re: trying to pass in repo element from Excel for click event

Post by hnporter » Mon Jan 27, 2014 9:05 pm

Thanks for your reply. Not a huge deal; since using the XPath works fine, that's how I'll proceed.