cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with perform click operation on PopupMenu

Highlighted
New Contributor

Problem with perform click operation on PopupMenu

I am using jscript 
I want to perform click opearation on PopupMenu object but its giving Error like PopupMenu is null or not an object

Object Properties values are -
Exists -True

Enabled - True

Name - WPFObject("Popup")

Visible - False

VisibleOnScreen - False

PopupMenu - null

I tried adding delay and waitProperty to wait until objects becomes visible on screen but not worked 😞 


Any suggestions are welcome ..

Thanks in advance 🙂

10 REPLIES 10
Highlighted
Community Hero

Re: Problem with perform click operation on PopupMenu

More information, please.  

 

Can you give the actual code that you're using?  Are you using NameMapping to find the object?  Can you give us a screenshot of the Object Browser showing the object in question with properties, hierarchy, etc? 

My guess:

 

Popupmenus are not recognized in TestComplete as objects to be "found" and interacted with.  They are properties on an object that allow a "Click" methodology.

 

See https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/window-and-process/po...

 

So, what you SHOULD do is have your parent object use that property as indicated in the documentation above.  Something like

 

parentObject.PopupMenu.Click("MenuItem")

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
New Contributor

Re: Problem with perform click operation on PopupMenu

I am not using Name mapping 

Highlighted
Community Hero

Re: Problem with perform click operation on PopupMenu

OK, then your code should be

WPFObject('Tbutton').Click()
WPFObject('Tbutton').PopupMenu.Click("Menu Item")




Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
New Contributor

Re: Problem with perform click operation on PopupMenu

Well , I tried but it doesnt work , giving Error : PopupMenu is null or not an object
Development Hierarchy shown as below :
image (4).png

Highlighted
Community Hero

Re: Problem with perform click operation on PopupMenu

The code of the AUT doesn't help.  Please provide the code you are actually executing in TestComplete.  We'll need that to determine what's going wrong.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Manager

Re: Problem with perform click operation on PopupMenu

Thanks tristaanogre!

 

@deshmukh Is this possible to provide the actual code? That would help the Community to try and troubleshoot!


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
New Contributor

Re: Problem with perform click operation on PopupMenu

Provided code in Private Message , Plz have a look

 

 

Thanks 🙂

Highlighted
Community Hero

Re: Problem with perform click operation on PopupMenu

I'm coping the code that I received via PM here so that the whole community can contribute to solution.

 

function commit() {

var umprocess =Sys.Process("Simplivity.UpgradeManager.View");

var tButton = umprocess.WPFObject("HwndSource: Shell", "HPE SimpliVity Upgrade Manager").WPFObject("Shell", "HPE SimpliVity Upgrade Manager", 1).WPFObject("RootGrid").WPFObject("ContainerView", "", 1).WPFObject("Grid", "", 1).WPFObject("ContentPresenter", "", 1).WPFObject("FederationView", "", 1).WPFObject("Grid", "", 1).WPFObject("radTreeListView").WPFObject("TreeListViewRow", "", 4).WPFObject("GridViewCell", "", 3).WPFObject("Grid", "", 1).WPFObject("Border", "", 1).WPFObject("Grid", "", 1).WPFObject("Tbutton")
tButton.Click();
aqUtils.Delay(200000);

var CommitMenu = tButton.PopupMenu
if(CommitMenu != null)
{
CommitMenu.Click();
}
}

 

Now that we have that code... where exactly does the error occcur?  On which line of the code?

 

Also, note that clicking on a popup menu, as per the documentation that I provided earlier, requires you to indicate WHAT item on that menu you're clicking. 

 

Another suggestion....  have you tried recording the steps?  It might be that what we think is the proper popup menu isn't the right one.  If you record a simple script with interaction with the components you want, that should show better what's going on.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Hero

Re: Problem with perform click operation on PopupMenu

@deshmukh :

 

tButton.Click();
aqUtils.Delay(200000);

var CommitMenu = tButton.PopupMenu

PopupMenu well may be not a child of the tButton object, but a child of some other window. Try to highlight it using Object Spy in the Point-And-Fix mode and check the hierarchy for the given popup menu object.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!