how to focus on specific screen if there exists two same window application screen
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to focus on specific screen if there exists two same window application screen
I am testing Windows application, like Create New Member. After i input data in "New Member" screen and click on "Save" button, then click on "Add Dependent" button, it will open the "Add Dependent" screen and same as "New Member". Now it seems that TC always focus on "New Member" screen, so TC will failure when need to input data in "Add Dependent" screen. So how can i just focus on "Add Dependent" screen.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
For focusing a window you need to use below code,
yourwindowObject.SetFocus()
And also not you have a unique properties for Test Complete to identify both both window objects.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now the two screen's window object was the same, do you know how to deal with this problem. thanks.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It would be better if you post tow objects properties.
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks, both widows have their unique property. But you have mapped both windows as same window.
Have you mapped both objects with below properties,
WndCaption
WndClass
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use below method to SetFocus, but it will prompt the message: cannot obtain the window with the window class "ThunderRT6FormDC", window caption "MRMEMBMNT01 - Member Maintenance - Add Dependent".
def FocusOnAddDependent():
obj = Aliases.Caesar.CSR_MAIN.MDIClient.MRMEMBMNT01
winobj = obj.Window("ThunderRT6FormDC", "MRMEMBMNT01 - Member Maintenance - Add Dependent")
winobj.SetFocus()
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you try below,
def FocusOnAddDependent(): obj = Aliases.Caesar.CSR_MAIN.MDIClient winobj = obj.Window("ThunderRT6FormDC", "MRMEMBMNT01 - Member Maintenance - Add Dependent") winobj.SetFocus()
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still cannot work, it will prompt the message "Python runtime error" and additional info "Runtime error Member not found".
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not a python script-er,
Aliases.Caesar.CSR_MAIN.MDIClient.MRMEMBMNT01 this is your expected object to click, But you are trying to find the same window again thats you getting error.
Aliases.Caesar.CSR_MAIN.MDIClient.MRMEMBMNT01.SetFocus()
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”