Identify and Click on a window popup object
I have some issue with identifying a window popup object. When I close a window a popup is displayed as follows and I need to check and click on the Exit button in the window. I tried to record the script but It identified only the popup full window but not the objects in the popup. And in the script it clicked on the button using x, y locations, Instead of using the x,y locations I need to use the button Exit as this pop-up can be located anywhere in the screen based on the screen size. How do I identify that object and what process I should use. The object in nameMapping recorded as wndChrome_WidgetWin_1
The script to click the object
Have you been through all these steps to prepare Chrome for testing?
Hi @Marsha_R, Most of these steps have done while installing the testComplete. I am even able to do record the web application and save to my project. But the issue here is when the alert message is displayed and that message is from Windows, then the object in that alert message is not identified. I need to record the button in that alert message.
I have a similar issue with the login object within Edge Browser that seems to appear everytime the browser gets updated and then the only thing that helps is:
1. Update Testcomplete
2. Make a function that first tries to find the button e.g. in your case that would be "Exit":
- if the button exists (meaning Testcomplete can interact with the button): Button.ClickButton()
- else: On the window object of that popup: Try to use .keys() to interact with the popup. You could try instead of clicking on the Exit button to close the popup with: PopUpWindow.Keys("[Esc]");
This is maybe not the best solution but i could not think of another way to solve this problem. Maybe it'll help you
Hi @DanNad, Thanks for your reply, but the solution you mentioned didn't help me. It's not identify the window as a popup. But I was able to fix the issue with a different method by using Close().
Aliases.wndChrome_WidgetWin_1.Close(). This closed the pop-up and able to continue next. This is still not a permanent fix I am looking for but can move on. Please let me know if anyone comes across how to identify the object in the popup alert