Forum Discussion

kpinnisetti's avatar
kpinnisetti
Contributor
11 years ago

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.

 
  • 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.
  • 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.
  • 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
  • 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.