cancel
Showing results for 
Search instead for 
Did you mean: 

Custom HTML Attributes not being found by TestComplete?

SOLVED
Highlighted
Frequent Contributor

Custom HTML Attributes not being found by TestComplete?

I cannot get TestCompletes name mapping feature to find html objects based on custom html attributes.  


I have a textbox for example that looks like this
<input class="classname" id="textboxID45874486997" type="text" data-auto="mytextboxid">

 

However, We have a lot going on right now with our project changing around and elements changing names etc.  I want the ability to tell the developers "Hey, you see this attribute called data-auto, yah, do not ever touch it"

This way, my scripts aren't breaking all the time when they do things like change ids. I find it very bizarre that TestComplete doesn't have this feature. Am i missing something?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: Custom HTML Attributes not being found by TestComplete?

I found it. 

I needed to switch from basic mode to conditional Mode
Then select Property and the type "Type Property Name"

Click enter, and then select value to be what ever you want.

image.png

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Re: Custom HTML Attributes not being found by TestComplete?

When you're mapping the object, if you scroll down the list of properties, you should see something that says "attributes [object]". Click in that field and an ellipses will show up.  Click that and you'll go to the attributes on the object.  Highlight the one you want and click the button to add it to your selected list.

 

attributes.png


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Frequent Contributor

Re: Custom HTML Attributes not being found by TestComplete?

Sorry, I have tried that. It only shows me the Length. I want it to look for the element with this data attribute.  See Image

 

image.png

Highlighted
Frequent Contributor

Re: Custom HTML Attributes not being found by TestComplete?

I can do this. 
Aliases.browser.page_General_Login.Find("data-Automation","username", 1000, true);
However i do not want to write it out in code. I want to be able to find it via the name mapping feature.

Highlighted
Frequent Contributor

Re: Custom HTML Attributes not being found by TestComplete?

I found it. 

I needed to switch from basic mode to conditional Mode
Then select Property and the type "Type Property Name"

Click enter, and then select value to be what ever you want.

image.png

View solution in original post

Highlighted
Community Hero

Re: Custom HTML Attributes not being found by TestComplete?

If you're editing the existing, then yeah, I don't think you can see all the attributes.  My screenshot was on an actual create new mapping panel. 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors