Forum Discussion

sathashiv5's avatar
sathashiv5
Contributor
3 years ago

PopupMenu Item Checked

Hi,

 

My test case is like, when right click on the taskbar need to verify if item("show touch keyboard button") in the popupmenu is checked or not. 
I can able to get the items using following snippet:

var pObj = Sys.Process("explorer");
var wObj = pObj.Window("Shell_TrayWnd", "", 1);
var get = wObj.Find("ObjectIdentifier", "Notification_Chevron", 50);
get.ClickR();
Delay(3000);
var pObj2 = Sys.Process("explorer");
var wObj2 = pObj2.Window("#32768", "", 1);
var getCount = wObj2.PopupMenu.Count;
Log.Message(getCount);

for(i = 0; i< getCount; i++)
{
var check = wObj2.PopupMenu.Items(i);
Log.Message(check.Caption);
//To validate if Popupmenu item is Checked ????
/*if(check.Checked)
{
Log.Message(check);
}*/
}

Also, in last conditional stmnt I am Checking, if item was checked. need to know whether it is correct or not?

  • ApplePen's avatar
    ApplePen
    Community Leader

    >Also, in last conditional stmnt I am Checking, if item was checked. need to know whether it is correct or not?

    Are all the items checkbox? If they are, you can uncheck them. 

    Then run your script again to check whether the result is same.

    If two results are the same, definitely it's wrong.

    • sathashiv5's avatar
      sathashiv5
      Contributor

      Hi ApplePen,

       

      Last If condition not working. I didn't know whether its right or wrong. Can you suggest me which property to use in order to verify the "Checked" status of popupmenu item(Item - "Show Touch keyboard button").