How can I write a SilkTest script to hold down the Control key while making 2 mouse clicks in a window?
To show how this can be achieved, the following illustration uses Microsoft PowerPoint as an example.
I want to select two objects from the window and have them both selected at the end of the operation.
In this case I want to select both "Click to add title" and "Click to add subtitle". Manually this is done by holding down the CTRL key and clicking in the desired locations to select all the objects, then releasing the CTRL key.
[-] testcase Test1 () appstate none [ ] Presentation1.SetActive () [ ] Presentation1.PaneClassDC1.PressKeys("") [ ] Presentation1.PaneClassDC1.Click (1, 254, 230) [ ] Presentation1.PaneClassDC1.Click (1, 285, 342) [ ] Presentation1.PaneClassDC1.ReleaseKeys("")
As you can see, the testcase above uses the PressKeys method to hold down the CTRL button while other clicks are being performed. It then finishes by releasing the CTRL key with the ReleaseKeys method. You will find the testcase and include file to run this example below;
Please note that Microsoft PowerPoint was used just as an example for this scenario. Microsoft do not use their own MFC classes for objects within Microsoft Office applications, rather they use non-standard 3rd party classes. Therefore when testing these controls via SilkTest, CustomWins are typically returned for MS Office applications and controls.