Identifying Custom Cursor
-
- Posts: 5
- Joined: Tue May 16, 2017 4:46 pm
Identifying Custom Cursor
Is there any way to identify custom cursors in Ranorex testing? I want the program to do something when it is a specific cursor, which happens to be custom. Thanks in advance.
Re: Identifying Custom Cursor
I save the cursor image when I first encounter it:
And then subsequently compare the current cursor image to this saved image. This works for both system and custom cursors, though system cursors can change between OS'.
I log the cursor images too, which helps clarify issues in the report.
Code: Select all
Bitmap mouse_cursor_bitmap = Mouse.GetCursorImage();
CompressedImage mouse_cursor_image = new CompressedImage(mouse_cursor_bitmap);
mouse_cursor_image.Store(mouse_cursor_file);
Code: Select all
Bitmap expected_cursor_image = Imaging.Load(cursor_image_filename);
Bitmap actual_cursor_image = Mouse.GetCursorImage();
:
Validate.IsTrue(Imaging.Compare(actual_cursor_image, expected_cursor_image, find_options), ...