Krypton Component button

Sep 12, 2012 at 11:13 AM
Edited Sep 12, 2012 at 11:13 AM

Hi, 

I am using UISpy to identify components to Automate UI using white. Krypton button is always identified as 'ControlType.Pane'. Please help me out in this.

Sep 14, 2012 at 7:35 AM

Hi

that is for tester bad, but this is what third party controls do in many cases. The don't implement the UIAutomation part for the custom control.

You can try to get the element as UIItem. And have a look what informations you can get from that element.

 

What informations do you need? And what actions do you want to perform?

 

Throndorin

Sep 14, 2012 at 8:07 AM

I am trying to perform click event of button.

Sep 14, 2012 at 10:08 AM

The try to use UIItem

 

UIItem button = parent.Get<UIItem>(SearchCriteria.ByAutomationId("id"));

button.Click();

if this not work.

 

use Mouse class to click on the button.ClickablePoint()

or try to set Focus on the button and use Keyboard to send Enter key

Throndorin

Sep 14, 2012 at 11:28 AM

If I try,

 UIItem cmdLogin = loginWindow.Get<UIItem>(SearchCriteria.ByAutomationId("cmdLogin")); //Login button

then cmdLogin is comming null.



I tried something like this.

UIItem cmdLogin = loginWindow.Get<Panel>(SearchCriteria.ByAutomationId("cmdLogin")); //Login button 

 

Assert.That(cmdLogin.Enabled);

cmdLogin.Focus();

 

Assert.IsTrue(cmdLogin.IsFocussed);

cmdLogin.KeyIn(White.Core.WindowsAPI.KeyboardInput.SpecialKeys.RETURN);

 

but cmdLogin.IsFocussed is false and I am not able to loginto application.

Sep 14, 2012 at 1:56 PM
Edited Sep 14, 2012 at 2:00 PM

OK

 

have you tried cmdLogin.Click(); ?

 

or Mouse

 

parentWindow.AttachedMouse.Click(cmdLogin.ClickablePoint());

Sep 14, 2012 at 2:14 PM

I tried cmdLogin.Click(), which  is not working.

and cmdLogin.ClickablePoint() is comming null. So cant execute another line as well.

Sep 18, 2012 at 6:53 AM

Hi

 

Then you should try to get a clickable point relative to the parent of the button.