Add flexibility to test step context

I am predominantly interested in testing content that exists in an iframe and the exact xpath to that iframe is out of my control. As I had been recording test steps for elements within in the iframe, I hadn’t realised that the exact iframe xpath was automatically being stored in the context property for each test step. The xpath for the iframe I am currently testing was recently changed, resulting in all my tests unable to locate the iframe elements (original forum post).

As I am currently faced with updating the context for every test step I’ve created, would it be possible to either parameterise, or make the test step context more flexible?. It would be useful to be able to control the context at a test level, or be able to use a test/project parameter for the value of the context.
An alternative solution could be to be able to control whether the test step context is automatically generated at a test level, or have the ability to decide what locator type is used to generate the context.

1 Like

Hi @heather_uhs , thanks for the suggestion, I have opened a feature request on this, (TP-16710)
I will update here when such a change is available.

1 Like

Hi, is there an update on this?

Hi @J.Hernandez3,
This will not be possible,
However you can create a step using javascript that perform the same logic that you want to achieve and paramaterize it’s locators in anyway that you want,
Or alternativaly create an addon that accepts a context and a locator, or a context and an element using the addons SDK and perform an action for example, type text, click etc…

If this still doesn’t work for you, you can always use Robot operations, to elimate the need of a locator completety for certain actions.