Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing menus in child windows #160

Closed
sachinkshirsagar opened this issue Sep 30, 2013 · 5 comments
Closed

Accessing menus in child windows #160

sachinkshirsagar opened this issue Sep 30, 2013 · 5 comments

Comments

@sachinkshirsagar
Copy link

Hi,

I have a parent window and a child window. The same set of menus are repeated from parent window to child window.
I could able to access Parent menus easily and automation works perfectly.
But when I try to access Child menus, they are not working.
I could access menus from both windows via VisualUIAVerify tool. Not sure what is an isssue?

Can anybody help me?

Here is my code snippet

_mainWindow = _application.GetWindow(SearchCriteria.ByText("XXX"), InitializeOption.NoCache);
TestStack.White.UIItems.Panel upperPanel = _mainWindow.Get<TestStack.White.UIItems.Panel>(SearchCriteria.ByText("XXXX1"));
TestStack.White.UIItems.Panel lowerPanel = upperPanel.Get<TestStack.White.UIItems.Panel>(SearchCriteria.ByText("XXX2"));
TestStack.White.UIItems.GroupBox grp = lowerPanel.Get<TestStack.White.UIItems.GroupBox>(SearchCriteria.ByText("XXX3"));

        TestStack.White.UIItems.MenuItems.Menu mnuParent = grp.Get<TestStack.White.UIItems.MenuItems.Menu>(SearchCriteria.ByText("MainMenu"));
        mnuParent.Click();

        TestStack.White.UIItems.MenuItems.Menu mnufromParent = grp.Get<TestStack.White.UIItems.MenuItems.Menu>(SearchCriteria.ByText("nfdsnfdfd"));
        mnufromParent.Click();

        _editWindow = Retry.For(() => _application.GetWindows().Find(w => w.Name.Contains("ABCDEFGHI")), TimeSpan.FromMinutes(2));

        TestStack.White.UIItems.Panel upperPanel1 = _editWindow.Get<TestStack.White.UIItems.Panel>(SearchCriteria.ByText("abcd1"));
        TestStack.White.UIItems.Panel lowerPanel1 = upperPanel1.Get<TestStack.White.UIItems.Panel>(SearchCriteria.ByText("abcd2"));
        TestStack.White.UIItems.GroupBox grp1 = lowerPanel1.Get<TestStack.White.UIItems.GroupBox>(SearchCriteria.ByText("abcd3"));
        TestStack.White.UIItems.MenuItems.Menu mnuChild = grp1.Get<TestStack.White.UIItems.MenuItems.Menu>(SearchCriteria.ByText("pqrty"));


        mnuChild.Click();
        TestStack.White.UIItems.MenuItems.Menu mnuabcd = grp1.Get<TestStack.White.UIItems.MenuItems.Menu>(SearchCriteria.ByText("menuabcd"));
        mnuabcd.Click();

        mnuChild.Click();
        TestStack.White.UIItems.MenuItems.Menu mnuHelp = grp1.Get<TestStack.White.UIItems.MenuItems.Menu>(SearchCriteria.ByText("Help"));
        mnuHelp.Click();

        mnuChild.Click();
        TestStack.White.UIItems.MenuItems.Menu mnuAbout = grp1.Get<TestStack.White.UIItems.MenuItems.Menu>(SearchCriteria.ByText("About"));
        mnuAbout.Click();

Thanks,
Sachin

@JakeGinnivan
Copy link
Member

Try .ModalWindow()

@sachinkshirsagar
Copy link
Author

I could get the childwindow object and its Child menu objects via C# code. But click on the 2nd Child Submenu is not working. Click on 1st Child Subment works.

1 similar comment
@sachinkshirsagar
Copy link
Author

I could get the childwindow object and its Child menu objects via C# code. But click on the 2nd Child Submenu is not working. Click on 1st Child Subment works.

@JakeGinnivan
Copy link
Member

Normally this is due to animations not finishing in time. Try adding some thread.Sleep()s to slow things down

@JakeGinnivan
Copy link
Member

Closing due to inactivity, assume sorted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants