cancel
Showing results for 
Search instead for 
Did you mean: 

How to verify text while hovering mouse over object?

SOLVED
Highlighted
Occasional Contributor

How to verify text while hovering mouse over object?

I am trying to verify text that appears when the cursor is hovered over an object. For example an object of a trash can which when hovered over displays "Delete". The word delete can not be navigated to since once the cursor moves off the trash can icon the word "Delete" disappears. 

 

I've tried right clicking on the icon which brings up a menu and then using the Shift+Ctrl+A to select the word "Delete", however that then gets mapped to the wrong item. I've also tried the Object Spy tool but that too selects the wrong item.

 

Thanks,

Mike - noob

1 ACCEPTED SOLUTION

Accepted Solutions
Community Leader

Re: How to verify text while hovering mouse over object?

Hi,

 

The easiest solution for you is to use ImageRepository in your script.

 

Example:
1) Hover your mouse cursor over the icon
2) Wait until the hit appears
3) Check ImageRepository if the image already exists on the screen
4) Look for the image in the repository
5) check the image value
6) Log results

 

Doc: https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/image-repository/ind...

 

Of course you can try to dynamically search for an object using .wait() or .find(), but you must write your own function for it.

 

Another solution is to enable this option:

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/text-recognition/...

and you can use this option to search for a textObject.

 

View solution in original post

3 REPLIES 3
Community Leader

Re: How to verify text while hovering mouse over object?

Hi,

 

The easiest solution for you is to use ImageRepository in your script.

 

Example:
1) Hover your mouse cursor over the icon
2) Wait until the hit appears
3) Check ImageRepository if the image already exists on the screen
4) Look for the image in the repository
5) check the image value
6) Log results

 

Doc: https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/image-repository/ind...

 

Of course you can try to dynamically search for an object using .wait() or .find(), but you must write your own function for it.

 

Another solution is to enable this option:

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/text-recognition/...

and you can use this option to search for a textObject.

 

View solution in original post

Highlighted
Occasional Contributor

Re: How to verify text while hovering mouse over object?

Thanks Wamboo!

The imagerepository worked well for what I needed to test. 

 

Cheers,

Mike

Highlighted
Community Leader

Re: How to verify text while hovering mouse over object?

I am happy to hear that!

 

Happy coding!