Can't find rect object to click on it

I’m trying to locate an object to click on, but neither the suite nor the SpyWeb can find it. When SpyWeb gives me the information and I click Verify and Highlight, it cannot locate the xpath. The current xpath looks like this:

//*[@id="3512:H3TZzEQu3kEC"]/rect

Cannot locate by xpath or id. Please help!!

Hi Amanda,

The ID seems to be dynamic. So you have to try some other locator strategy. SpyObject normally records the current ID of the element in a session and store it in the repository but in the next session when you run the test it will not identify since the ID of the element would have changed. So, I would suggest to find a common attribute of the element and use some advanced xpath concepts. For example, in your xpath I feel ‘3512’ portion of ID is static, so edit the object in the repository and put xpath as:

//*[contains(@id,"3512")]/rect

Hope it helps!

Thank you. I appreciate your help. That’s what I thought. I’ll look for a better way