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

Element not found error while trying to find an dynamic element using HtmlFind Expression

5 Answers 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 22 Aug 2013, 08:49 AM
Hi,

I am trying to create an object for dynamically generated HtmlInputText and HtmlButton using HTML find expression by providing the following properties of the element - id, Tagname, name and Xpath, but the element is not getting identified, getting element not found error.

- The text and button object that needs to be identified is available in one of the Cell in Table (Rows in the table gets dynamically added based on user input).

Please provide the solution for identifying these dynamic objects using Telerik asap.

Thanks,
Vijula

5 Answers, 1 is accepted

Sort by
0
Alan
Top achievements
Rank 2
answered on 22 Aug 2013, 04:13 PM
Hello Amit,

We've had this issue before and have gotten around it by reducing the number of attributes in our identification logic.  It looks like you are identifying on four attributes for your element.  Could you possibly reduce that to two?  Additionally, our "id" attribute is dynamically generated, so we are unable to use that attribute for our elements--might yours also be dynamic?  Lastly, you could also try to refresh the DOM tree with a coded step:

Manager.ActiveBrowser.RefreshDomTree();

Good luck!
Alan
0
Vijula
Top achievements
Rank 1
answered on 23 Aug 2013, 05:09 AM
Thanks Alan,
I have already provided the below line of code in my code, also i have tried with different combinations of properties and element types. still it was not working
0
Alan
Top achievements
Rank 2
answered on 23 Aug 2013, 01:31 PM
Are you using a Wait For IsVisible instead of a Wait For Exists verification step?  Is your timeout value too quick?  If the site you are using is public, attach a zip of your error with the DOM and we can see what else to try.  If not public, you should submit a private ticket to Telerik Support.

Alan
0
Ivaylo
Telerik team
answered on 27 Aug 2013, 08:50 AM
Hello Amit,

You have a ticket opened regarding this case (ticket ID 729185) and here is the latest reply from my co-worker Velin:

Hi Vijula,

Thank you for contacting Telerik Support.

You should be able to achieve this. You can read in this article how you can change the find expression. I would also recommend you to see this article about using chained find expressions
You might find useful watching this short video that will show you some good practices how to work with find expressions.
You can also achieve this only in code, you can use our documentation as a guide-line. 

If you need additional assistance, in order to help you best, please provide us with a copy of your test and if it is possible, grant us access to your application so we can reproduce the issue on our end and give you a solution. 

If direct access is not possible, capture a Fiddler trace and attach it to this support ticket in a zip file. If you are unfamiliar with how to do so, this link will provide you with step-by-step instructions for download and use. Please make sure to enable 'Decrypt HTTPS traffic' and 'Store binaries' options (see attached image) before starting capture.

Let's keep the communication on one place (here) in order to avoid double work.

Thank you for your understanding.
Regards,
Ivaylo
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Vijula
Top achievements
Rank 1
answered on 05 Sep 2013, 05:30 AM
Thanks Ivaylo, i was able to find the dynamicallu generated text filed using Chained expression.
Tags
General Discussions
Asked by
Amit
Top achievements
Rank 1
Answers by
Alan
Top achievements
Rank 2
Vijula
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or