This is a migrated thread and some comments may be shown as answers.

Unable to Find Element (Found using back-up search)

16 Answers 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shiva
Top achievements
Rank 1
Shiva asked on 10 Jul 2014, 09:53 AM
Hi,

I have been trying to perform a 'click' for long time now. The Normal Click, Desktop Click, Hover over seems unable to locate element. 
The Edit Suggestion for Element is find element.jpg attached.
The Id is dynamically generated (keeps changing) so, we cannot make it an identifier. Any other logic will fail to locate element. 

The Expected image, image on failure and DOM is ExpectedImage.png attached

What would you recommend this type of element? 

Best Regards,
Shiva

16 Answers, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 1
answered on 11 Jul 2014, 02:20 PM
Have you tried a contains instead of exact for the class in the find logic or even just removing the class from it altogether and relying on the image source?
0
Shiva
Top achievements
Rank 1
answered on 11 Jul 2014, 02:33 PM
Hi Sean, 
I changed the exact to contains. This time It pass through the step but never really clicked and step after it is failed.

I have encountered similar problem in a lot of Clicks- where it will pass through the step but doesn't perform click.
I'm Using Internet Explorer 11. I'm afraid the problem is in the UI of our application.

Any help would be appreciated.

Thank you,
Shiva   
0
Sean
Top achievements
Rank 1
answered on 11 Jul 2014, 04:01 PM
Is SimulateRealClick enabled? Sometimes I get things to work by toggling this setting on or off depending on the way it is set when it fails to click something.  
0
Shiva
Top achievements
Rank 1
answered on 11 Jul 2014, 04:05 PM
I did. Sometimes it works and sometimes it won't.  And these are the situations most difficult to handle. 

I wouldn't normally simulate a click because it seems to affect the steps. 
0
Boyan Boev
Telerik team
answered on 15 Jul 2014, 06:59 AM
Hello,

@Sean, thank you for helping others. We really appreciate it.

@Shiva, you can try also adding WaitForExists step before the click step.

Please give that a try and let us know the result.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Shiva
Top achievements
Rank 1
answered on 15 Jul 2014, 01:22 PM
Hi Boyan, 

The waitelementexist failed too. It just won't locate the element. 

Failure Information: 
~~~~~~~~~~~~~~~
Element was 'not found'. Criteria: Element 'Exists'.
Page being searched 'Page (RedOwl - Skills Grade Matrix)'.
Unable to locate element. Details: Attempting to find [Html] element using 
Find logic 
 (Html): [id 'Exact' ext-gen229] AND [tagname 'Exact' img]

Unable to locate element. Search failed!

Thank you,
Shiva
0
Sebastian
Top achievements
Rank 1
answered on 16 Jul 2014, 12:58 PM
Use ID and TagName to detect the button.
0
Boyan Boev
Telerik team
answered on 17 Jul 2014, 07:44 AM
Hi,

It seems that the ID is dynamically generated. Is that true?

If this is the case, you should use another attribute which doesn't constantly change or the static part of the ID only.

Hope this helps. 

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Sean
Top achievements
Rank 1
answered on 17 Jul 2014, 09:41 PM
Is this element possibly within a frame? And if so does the frame have a dynamic ID I run into this a lot by removing the frame ID and Name in the properties I am able to get around the element being found but not being click. 
0
Sebastian
Top achievements
Rank 1
answered on 17 Jul 2014, 10:22 PM
A big part of this is having your recording options set to work with the site you are testing against too.

I run my tests on more than one base Url.
For this reason I set my Compare Mode to - RelitivePathAndQuery.
This helps with the Frame problem I was having; it might help you.

I also have Simulate Real Clicks by Default turned on.

Identification Logic is important too.

The site I’m working on at the moment, works best when I cut my list down to-

id
TagName
TagIndex(locked)
Text(Locked)

After you figure out what identification types work well with your site, go in and edit the list so it doesn't try things that won't work.
0
Shiva
Top achievements
Rank 1
answered on 18 Jul 2014, 09:40 AM
Hi Boyan, 

Yes ID is dynamically generated and I have been using other attributes until now but in this case any other identifier won't locate the element (found using backup)
It seems we need to ask developers to give static ID.

@sean How did you overcome the element in frame (found but not click) ? 
@sebastian Where is the compare mode 'RelitivePathAndQuery' ? The simulate real clicks sometimes clicks different places and causes problems. 
I have been mostly using the TagName & TextContent  and occasionally ID.

 
 
Thank you

0
Sebastian
Top achievements
Rank 1
answered on 18 Jul 2014, 02:16 PM
Go to Projects Setting
Then click on Recording Options
0
Sean
Top achievements
Rank 1
answered on 18 Jul 2014, 09:53 PM
I found that the frames themselves had dynamic IDs so every time the frame displayed it had a new ID even though the content is always the same.  If you click on the frame in your element list you can edit the frame properties.  I just delete the ID and in some cases even the name.  Same with fancybox overlays whack the ID from the properties and the elements within are found.   See pic attached
0
Boyan Boev
Telerik team
answered on 21 Jul 2014, 10:03 AM
Hi,

Here is also an article which describes how to overcome frame dynamic ID.

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Sebastian
Top achievements
Rank 1
answered on 21 Jul 2014, 03:00 PM
Yeah, this is where having the project settings setup for your site will make all the difference.
Playing with the Recording Options and the Identification Logic will make the Frames as well as the element record in a way that will work with your site.
Then you won't have to go back and edit all the frames or loads of elements.
0
Boyan Boev
Telerik team
answered on 22 Jul 2014, 07:53 AM
Hi Shiva,

Please let us know if you still experience this issue or if you need any additional assistance.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Shiva
Top achievements
Rank 1
Answers by
Sean
Top achievements
Rank 1
Shiva
Top achievements
Rank 1
Boyan Boev
Telerik team
Sebastian
Top achievements
Rank 1
Share this question
or