Ask a Question

Checkpoint for Highlighted textbox

SOLVED
kpinnisetti
Contributor

Checkpoint for Highlighted textbox

Hi can any one give me sample script on how i can use checkpoint for the higlighted textbox?

See the attached.

 
1 ACCEPTED SOLUTION

Accepted Solutions
Colin_McCrae
Community Hero

RE: Checkpoint for Highlighted textbox

For checking graphical stuff like that, I tend to use the CSS properties of the objects.



What you check will depend on the browser you're using. They're not 100% consistent on how they report things to TestComplete.



Something like: <object>.ownerDocument.defaultView.getComputedStyle(<object>, "").backgroundColor



Or it may just be sufficient to check the visibility of the highlight box around the textbox.



It very much depends how the dev people have done the highlighting.

View solution in original post

3 REPLIES 3
Colin_McCrae
Community Hero

RE: Checkpoint for Highlighted textbox

For checking graphical stuff like that, I tend to use the CSS properties of the objects.



What you check will depend on the browser you're using. They're not 100% consistent on how they report things to TestComplete.



Something like: <object>.ownerDocument.defaultView.getComputedStyle(<object>, "").backgroundColor



Or it may just be sufficient to check the visibility of the highlight box around the textbox.



It very much depends how the dev people have done the highlighting.

View solution in original post

kpinnisetti
Contributor

RE: Checkpoint for Highlighted textbox

Thanks for the reply Colin, for that object it has property which has value className = highlight. I'm using that.



If DLNum.className = "highLight" then

log.Message("Highligted")

Else

log.Message("Not Higlighted")

End

IF
Colin_McCrae
Community Hero

RE: Checkpoint for Highlighted textbox

Cool.



However .....



I've run into several ways of doing it.



Including:



Adding a class



combined with:



CSS background colour

CSS width

Visibility of the object

Transparency/opacity settings



Among others.



The only thing I'm wary of by using class names is that they don't necessarily reflect whats actually happening on the screen. If the class name is used but the CSS is not updated to act on it then it can have the class name but remain un-highlighted.



So I would actually still check the CSS info for that one. The class is the flag to say what SHOULD be happening. The CSS info is the part that tells you what is ACTUALLY happening.
cancel
Showing results for 
Search instead for 
Did you mean: