我想通过Coded UI脚本填写谷歌浏览器的Chrono下载管理器中的一些数据。
我能够在工具栏上找到按钮以打开扩展程序但无法获得此扩展程序的任何控件。
请建议我如何访问扩展程序的所有控件。
部分样本代码如下:
public void FileChromaManagerDownload()
{
// this.UIMap.RecordedMethod4();
// BrowserWindow.CurrentBrowser = "chrome";
WinWindow window = new WinWindow();
window.SearchProperties[WinWindow.PropertyNames.Name] = "Google - Google Chrome";
window.SearchProperties[WinWindow.PropertyNames.ClassName] = "Chrome_WidgetWin_1";
window.WindowTitles.Add("Google - Google Chrome");//This window name may be different as per the website or tab
// window.DrawHighlight();
// WinControl uIItemImage = this.UINewTabGoogleChromeWindow.UIChronoDownloadManageButton.UIItemImage;
WinControl dnBtn = new WinControl(window);
// Chrono Download Manager
// window.SearchProperties.Add(BrowserWindow.PropertyNames.FriendlyName, "Chrono Download Manager");
dnBtn.SearchProperties.Add(WinButton.PropertyNames.ControlType, "Button");
dnBtn.SearchProperties.Add(WinButton.PropertyNames.Name, "Chrono Download Manager");//Chrono Download Manager //Download all resources on this page
// dnBtn.DrawHighlight();
WinControl mUIItemImage = new WinControl(dnBtn);
mUIItemImage.SearchProperties[UITestControl.PropertyNames.ControlType] = "Image";
// mUIItemImage.DrawHighlight();
Playback.Wait(1000);
Mouse.Click(mUIItemImage);
window = new WinWindow();
window.SearchProperties[WinWindow.PropertyNames.Name] = "Chrome Legacy Window";
window.SearchProperties[WinWindow.PropertyNames.ClassName] = "Chrome_RenderWidgetHostHWND";
window.SearchProperties[WinWindow.PropertyNames.ControlType] = "Client";
window.DrawHighlight();
window.SetFocus();
//TODO - Now I am not able to fetch any controls of popup windows
}
答案 0 :(得分:0)
编码的用户界面不直接支持Chrome。您必须在项目中使用一些selenium dll并在IE中捕获对象,然后在chrome中执行它们。