Ask a Question

identify a web element

SOLVED
SiwarSayahi
Occasional Contributor

identify a web element

Hi,

 

I have a web element without any static identifier.

So i decide to detect this element using the css selector , based on the text.

But i don't find a way with testComplete scripting.

The example is :  <span >CHF</span>

 

 

Thank you for your support,

5 REPLIES 5
tristaanogre
Esteemed Contributor

Have you looked at this article?

 

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/finding-objects...


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
SiwarSayahi
Occasional Contributor

Hi Robert,

Thank you for your response.

 

The solution is working for me, but using this solution I should get all elements with the same selector and filter after that the result by text, it is taking much time and performance that's why i am searching for a direct solution like the function span:contains('CHF') which is not supported by testComplete.

 

BR,

So, the next question is, why are you using CSS Selector?  Is this an object that cannot be idenfied via Object Browser or Object Spy and, therefore, unable to be mapped via NameMapping?


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
SiwarSayahi
Occasional Contributor

The tested object can be identified via Object spy, but it has no unique criteria for the identification.

I will accept your solution, i think there is no other way.

 

It may not have a single property but there may be a combination of properties that sets it apear from others.  You say you want to use the CSS Selector.  Those properties are also accessible for NameMapping.


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
cancel
Showing results for 
Search instead for 
Did you mean: