Hi,
If the xPath of the button keeps on changing every time you open the web link/app, it might be a difficult task to detect that button. Still, a way around could be to spy the different locations of the button using HTML mode and compare the xPaths of each. You will find that there will be a specific value that changes every time in the xPath.
For example, if following are the xPaths from different location, then you can proceed to make the changing value dynamic.
/HTML/FRAMESET(1)/FRAME(4)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(2)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(1)/HTML/BODY(1)/FORM(1)/TABLE(3)/TBODY(1)/TR(1)/TD(1)/BUTTON(1)
/HTML/FRAMESET(1)/FRAME(4)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(2)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(1)/HTML/BODY(1)/FORM(1)/TABLE(3)/TBODY(1)/TR(2)/TD(1)/BUTTON(1)
/HTML/FRAMESET(1)/FRAME(4)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(2)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(1)/HTML/BODY(1)/FORM(1)/TABLE(3)/TBODY(1)/TR(4)/TD(1)/BUTTON(1)
Your dynamic xPath should be stored in a data item xPath with value as /HTML/FRAMESET(1)/FRAME(4)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(2)/HTML/FRAMESET(1)/FRAMESET(1)/FRAME(1)/HTML/BODY(1)/FORM(1)/TABLE(3)/TBODY(1)/TR(@id)/TD(1)/BUTTON(1).
Next, start with an count =1, and in Calculation stage, use the Replace function as Replace(xPath, ""@id"", count). Then try to perform action on the item using the updated xPath. If you cannot find the correct one, move to the next value and continue doing the same till you find the one required.
Hope this helps.