Tried every listed option but cannot find Ribbon within a Pane control using White. Although VisualUIAVerify shows it in a tree.
"window" "Test 0.0.1" "MainForm"
|--"pane" "Dock Top" "_MainForm_Toolbars_Dock_Area_Top"
|--"" "Ribbon" ""
|--"tab" "Ribbon Tabs" ""
|--"tab item" "Tools" ""
I want to automate click on tab item "Tools". but can find only a "pane"
import clr
import sys
sys.path.append(r"C:\TEMP\white")
clr.AddReference("White.Core")
clr.AddReference("White.NUnit")
from White.NUnit import *
from White import *
from White.Core import *
from White.Core.Configuration import *
from White.Core.UIItems import *
from White.Core.UIItems.WindowItems import *
from White.Core.UIItems.ListBoxItems import *
from White.Core.UIItems.Container import *
from White.Core.UIItems.Finders import *
from White.Core.Factory import *
from White.Core.Finder import *
from White.Core.AutomationElementSearch import *
from White.Core.WindowsAPI import *
from System.Diagnostics import Process
wp= Process();
wp.StartInfo.FileName = r"c:\TEMP\gui\TestShell.exe";
wp.StartInfo.Arguments = r"TestShell.taco -e DBA -s qa";
wp.Start();
wapp = Application.Attach( wp );
wnds=Application.GetWindows(wapp)
wnd=wnds[0]
#test
>wnd.Name
"Test 0.0.1"
I can even click tab Tools provided coordinates (IronPython).
def click(cp,mouse,x,y):
cp = wnd.Bounds.TopLeft;
cp.Offset(x, y);
mouse = Desktop.Instance.Mouse;
mouse.Location = cp;
mouse.Click(cp);
cp = wnd.Bounds.TopLeft;
mouse = Desktop.Instance.Mouse;
mouse.Location = cp;
mouse.Click(cp);
click(cp,mouse,120,50) #tools
Getting to a pane:
pn=wnd.GetElement(SearchCriteria.ByAutomationId("_MainForm_Toolbars_Dock_Area_Top"));
tying to find a ribbon
rbn=pn.GetElement(SearchCriteria.ByAutomationId("Ribbon"));
or find all children
pn.FindAll(TreeScope.Children, Condition.TrueCondition)
Nothing seems to work.