Testing between versions of Microsoft Office Microsoft have changed the hierarchy of backstage view
so in word 2010 the paths looks like
/form[@title='Document1 - Word']//container[@automationid='BackstageView']/list[@automationid='NavBarMenu']/listitem[@name='Print']
and in Word 2013 it looks like
/form[@title='Document1 - Word']//container[@automationid='BackstageView']/contextmenu[@automationid='NavBarMenu']/tabpage[@name='Print']
could I switch repositories so could put all 2016 in one and all 2013 at runtime after detecting the version of The office Application started?
or switch the repository object string dependent on the version?
Or is there a better way other than creating new tests for each version?
Thanks Adrian
Automating for Office versions
Re: Automating for Office versions
I would keep it simple and just make the RanorexPaths more robust to work in both versions. Check out the "New" path below that I created by replacing the different element types with wild cards.
As long as there are no other elements with name='Print' under an element with the automationid='NavBarMenu', this should work well. You can add more attributes to the wildcard elements to make it more accurate while keeping the element type wild.
Code: Select all
2010: /form[@title='Document1 - Word']//container[@automationid='BackstageView']/list[@automationid='NavBarMenu']/listitem[@name='Print']
2013: /form[@title='Document1 - Word']//container[@automationid='BackstageView']/contextmenu[@automationid='NavBarMenu']/tabpage[@name='Print']
New: /form[@title='Document1 - Word']//container[@automationid='BackstageView']/*[@automationid='NavBarMenu']/*[@name='Print']