Forum Discussion
Hi!
Try to interact with Page object instead of BrowserWindow:
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.
Thanks!
Erik
- baxatob7 years agoCommunity Hero
Try to call snippet: Alias.browser.BrowserWindow(1).SetFocus();
Does it help?
- ehendin7 years agoNew Contributor
I seem to be making progress with this:
Sys.Browser("firefox").BrowserWindow(1).SetFocus()
- baxatob7 years agoCommunity Hero
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/overview.html
- ehendin7 years agoNew Contributor
Yes, the below worked.
Sys.Browser("firefox").BrowserWindow(1).SetFocus();
Yes, thank you! I know I need to better harness the power of name mapping, I will follow your advice. I have much to learn in the TC realm.. will also need to brush up on my JavaScript.
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!
Erik
Related Content
Recent Discussions
- 2 days agovladd1