impossible to find the correct iframe with a variable in the xpath

I have a web application did with Pega system.
The id iframe are dynamic.
So to find element in the web page i need to know the correct iframe otherwise the web element are not find in the web page.
For this I use a variable (test_frame2) to cath the id of the iframe of the page.
I have an iframe object and I use this variable in the xpath of the ifrmae object (//iframe[@id=’${test_frame2}’]). Like this the xpath is dynamic in function of the variable value.
After that the web object use the parent iframe done with the dynamic xpath.
After execution I have an error message with the object who use the parent iframe:
Unable to find the element located by ‘By.xpath: //iframe[@id=’${test_frame2}’]’

I don’t know if the variable is well replaced by her value?
Like in the log of the error there is the variable test_frame2 and not the value.
In the log I print too the test_frame2’s value and she’s correct like Pegagadget5

Thanks for you feed back

Hi @stephane.callea,

To parameterize Web test object locator, please follow our document: