Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43795

Wiki Page: Getting Offsets for low-level events when testing Custom Controls

$
0
0
One of the most frustrating parts of creating tests that rely on low-level events is getting the co-ordinate offsets of the objects you want to interact with. The attached small program - getMousePos - should ease this frustration considerably by getting the offsets for you.There is one caveat with this: either the application must be full-screen or alternatively, it can be relied upon to always appear in the same place. Mouse Position uses the top left corner of the monitor as the absolute position to work from. If you want to get the rectangle co-ordinates of a object then proceed as follows: 1. Identify the top left corner of the child container and select ctrl+tab to freeze the display 2. Select 'Copy To Offsets' to transfer the co-ordinates to the X and Y offset boxes. The X Pos and Y Pos boxes will now use these co-ordinates as the starting point 3. Select 'Start Tracking' and move to the lower right corner of the object 4. Select ctrl+tab to freeze the display again 5. The display will now give you the x and y offset and the size of the rectangle required for the SilkTest RECT parameter 6. Select 'Show Rectangle' to get the absolute co-ordinate set. Selecting 'Move to Pos' will move the mouse cursor to X Pos and Y Pos relative to any X Offset and Y Offset. Required: dotNet Framework 4.0 or later. This utility is provided 'as-is' and is not supported by Micro Focus. (Please visit the site to view this file)

Viewing all articles
Browse latest Browse all 43795

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>