Forum Discussion
FoundDeviceView Click ... Clicks at point (96, 27) of the 'FoundDeviceView' object.
FoundDeviceView DblClick ... Double-clicks at point (34, 3) of the 'FoundDeviceView' object.
RadiobuttonAlwaysRespondTo ClickButton Clicks the 'RadiobuttonAlwaysRespondTo' radio button.
RadiobuttonAlwaysRespondTo2 ClickButton Clicks the 'RadiobuttonAlwaysRespondTo2' radio button.
ButtonOk ClickButton Clicks the 'ButtonOk' button.
Region Checkpoint SampleRegionCheckPoint Aliases.KuliteConfig.HwndSource_MainWindow.MainWindow.DockPanel.StatusBar.StatusbaritemFound1Device, ... Compares the SampleRegionCheckPoint Stores item with the image of the Aliases.KuliteConfig.HwndSource_MainWindow.MainWindow.DockPanel.StatusBar.StatusbaritemFound1Device object.
I think you would have better luck checking for the text "Found 1 Device" in the object than you will in comparing regions. The text will exist no matter where the region ends up (which can change with screen size, etc.).
In the lines before that, you should also consider Click and DblClick using the object name rather than on a point. You may run into the same problem as with the regions and things will move a bit on the screen and with points your test will fail but objects should make it more flexible.
- Colin_McCrae9 years agoCommunity Hero
100% agree with Marsha.
That's a pretty horrible way you're doing it. It all looks very fragile, easy to break, and unlikely to work on any other machine.
- varsha9 years agoOccasional Contributor
Can you please tell me what is the appropriate way i should record my test?
- Colin_McCrae9 years agoCommunity Hero
Impossible to say without a better look at the application, it's objects, and their properties.
But, in general .....
Use reliable object properties etc to identify them. Which should get rid of the co-ordinate based clicks. (We have no idea what type of control you're clicking on here so that's a guess.)
And use properties of the object to capture the text, rather than relying on image comparisons.
Both the above should only really be last resorts. And in the case of the co-ordinate based clicks, if you have to use them, you are always best to capture co-ordinates and/or sizes of an object, and possibly it's parent object(s), during the run and use those to calculate the correct co-ordinates yourself. Using recorded ones is VERY fragile and not very portable.
Plus, I'm afraid, simple record and playback does tend to be quite limited. Using a recording as a basis for a test is OK. but you generally have to tidy things up and optimise them to get the most out of it.
Related Content
- 2 years ago
Recent Discussions
- 2 days ago
- 8 days ago
- 11 days ago