Problem with TestComplete locating a pop up
I have been trying to find a solution or even a workaround for an issue with my TestComplete Keyword mode script, which seems unable to find a pop up window. I actually see the application is launching a pop up with the name "Scheduler" but I believe since I did not create the popup I cannot reference it by that name.
In any event I tried looking at this link but there is still a missing piece for me.
I am able to select the window with the object spy. However, here is what I am doing incorrectly - I try to use setFocus() as a code snippet to change the focus to the popup window... In Object Spy the Window is named "BrowserWindow(1)" but "BrowserWindow(1).setFocus() does not work (not surprisingly).
In Selenium there is a way to "getWindowHandles()" to get all open windows and then you switchTo() and reference the window you want.
My object map has the element but basically I want to switch the focus to the popup - enter some data in input fields on the popup, and then close the popup via click of another button (if I can switch the focus the rest should be easy).
Thanks in advance for any suggestions you may have... I attached some screenshots.
(~ (TestComplete Version: 12.42.3048.7 x64 | Firefox 52.4.1 (64-bit) ~)
Solved! Go to Solution.
Thanks, baxatob! I am finding I am going down quite the rabbit hole with this.
Can you give me an example syntax for doing this? TestComplete seems to want me to "define" the Page object.
When you say, "Try to interact with Page object instead of BrowserWindow"
I understand I can look at the page object and work with its methods... but I find that it tells me that the page object is undefined, and I am clearly not either referencing it properly or defining it to TestComplete's satisfaction.
Conceptually I am trying to locate the window and change the focus to the window so I can then perform some actions on that window. I could also try to locate all the children of "Sys" that are browser windows, and pick the one with the URL in question, but it seems like that is not how TestComplete "works".
Part of the problem may be that I am in keyword mode where I feel like my low-level control of what is happening may be limited, but I have only used the script mode for piecemeal things.
Sure, you can't ignore parents 🙂
P.S. Also I would recommend to learn more about NameMapping: https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/over...
Yes, the below worked.
In another life I was a front-end developer, but I have been in QA for years, and mostly worked with Selenium and Java... it's very different the way TC handles its repository..
Thank you! And Happy New Year!