Customizing xpath generation

Write a Groovy code which creates a Test Object on the fly.

It will read an existing Test Object with xpath //button[@id=‘staticId1:dynamicId:staticId2’]/span

It will translate the xpath into another one like //button[starts-with(@id,'staticId1') and ends-with(@id,'staticId2')]/span

Then it will create a new Test Object using the generated xpath.

XPath2.0 ends-with() function is not available to us. But alternative (very verbose) xpath expression can do the same query

Let me work out for a few days for developing a solution.