Page 1 of 1

Hoe can I validate button within user code

Posted: Thu Mar 26, 2020 6:26 am
by felixk91
Hi everyone,

I am trying to validate button within menu ribbon in user code module.
The following code is to get attribute value:

Code: Select all

 
 var buttonChecked = repo.LayoutWindow.ButtonValidation.GetAttributeValue<string>("AccessibleState").Contains("Checked");
 
But this call return null.
In case I am running

Code: Select all

       
        public void Validate_ButtonValidation(RepoItemInfo buttonInfo)
        {
            Report.Log(ReportLevel.Info, "Validation", "Validating AttributeContains (AccessibleState>'Checked') on item 'buttonInfo'.", buttonInfo);
            Validate.AttributeContains(buttonInfo, "AccessibleState", "Checked");
        }
it passed.
Can someone help me to understand why GetAttrubuteValue function doesn't work for me?

I have to validate if button selected or not and then do some steps accordingly.
I added snapshot of the button.

Thanks,
Felix.

Re: Hoe can I validate button within user code

Posted: Thu Mar 26, 2020 8:11 am
by odklizec
Hi,

Try to use GetAttributeValueText instead.

Re: Hoe can I validate button within user code

Posted: Thu Mar 26, 2020 8:32 am
by felixk91
Thank you odklizec for help.