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?
Solved! Go to Solution.
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.
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.
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
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.
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.
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.
Subject | Author | Latest Post |
---|---|---|