Code: Select all
/form[@processname='EXCEL' and @class='XLMAIN' and @instance='0']/element[@class='EXCEL2' and @instance='0']/container/element/element/container/button[@accessiblename='Maximize']
/form[@processname='EXCEL' and @class='XLMAIN' and @instance='1']/element[@class='EXCEL2' and @instance='0']/container/element/element/container/button[@accessiblename='Maximize']
For example if I hard code instance 0, the test case will crash if I try to click the button in instance 1.
I'm thinking, is there any code such as Ranorex.Button = GetPath("excel").ToString()
or
Ranorex.Button = "/form[@processname='EXCEL' and @class='XLMAIN' and @instance='*']/ .... button"
??