当前位置: 首页>>代码示例>>C#>>正文


C# Manager.LaunchNewBrowser方法代码示例

本文整理汇总了C#中Manager.LaunchNewBrowser方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.LaunchNewBrowser方法的具体用法?C# Manager.LaunchNewBrowser怎么用?C# Manager.LaunchNewBrowser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Manager的用法示例。


在下文中一共展示了Manager.LaunchNewBrowser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

        public Manager Setup(String _homePage)
        {
            // Initialize the settings
            Settings mySettings = new Settings();

            // Set the default browser + Silverlight
            mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
            mySettings.Web.EnableSilverlight = true;
            mySettings.ExecutionDelay = 0;
            mySettings.AnnotateExecution = false;

            // Create the manager object
            Manager myManager = new Manager(mySettings);

            // Start the manager
            myManager.Start();

            // Launch a new browser instance. [This will launch an IE instance given the setting above]
            myManager.LaunchNewBrowser();

            // Navigate to a certain web page
            myManager.ActiveBrowser.NavigateTo(_homePage);

            return myManager;
        }
开发者ID:ekostadinov,项目名称:MyProjects,代码行数:25,代码来源:BaseTest.cs

示例2: StartTest

        public static void StartTest(string TestBrowser)
        {
            BrowserType browserType=new BrowserType();
            switch (TestBrowser)
            {
                case "IE": browserType = BrowserType.InternetExplorer; break;
                case "FF": browserType = BrowserType.FireFox; break;
                case "C": browserType = BrowserType.Chrome; break;
            }

            //Manager newManager = new Manager(new Settings(browserType, @"c:\log\"));
            //Manager newManager = new Manager(new Settings(browserType, @"c:\log\"));
            var browserSettings = new Settings();
            browserSettings.Web.DefaultBrowser = browserType;
            Manager newManager = new Manager(browserSettings);

            newManager.Start();
            newManager.LaunchNewBrowser();
        }
开发者ID:reggieesposa,项目名称:CustomTestAutomation,代码行数:19,代码来源:ControllerUtility.cs

示例3: TestWeb

        public void TestWeb()
        {
            Settings mySettings = new Settings();
            mySettings.Web.DefaultBrowser = BrowserType.FireFox;
            mySettings.Web.EnableSilverlight = true;
            Manager myManager = new Manager(mySettings);
            myManager.Start();
            myManager.LaunchNewBrowser();
            // Navigate to the page
            //myManager.ActiveBrowser.NavigateTo(URL, false);

            // Launch a browser instance
            browser = Manager.Current.ActiveBrowser;
            browser.NavigateTo(URL, false);
            browser.WaitUntilReady();
            var aframes = browser.Frames;
            var adesktop = browser.Desktop;
            var time = browser.CommandTimeOut;
            var tree = browser.DomTree;
            var nodes = tree.Root.ChildNodes;
            var child = tree.Root.Children;

            // Get an instance of our Silverlight app.
            SilverlightApp app = browser.SilverlightApps()[0];

            var xmllist = app.Find.AllByType<Button>();
            var uilist = app.Find.AllByType<ArtOfTest.WebAii.Silverlight.UI.Button>();
            var idlist = app.Find.AllByAutomationId("radButton");

            var byname = app.Find.AllByName("EXPLORE ALL CONTROLS");
            var text = app.Find.AllByTextContent("EXPLORE ALL CONTROLS");
            app.RefreshVisualTrees();

            // Click the button
            var btn = app.FindName<ArtOfTest.WebAii.Silverlight.UI.Button>("EXPLORE ALL CONTROLS");
            btn.User.Click();

            // Verify the text
        }
开发者ID:ekostadinov,项目名称:MyProjects,代码行数:39,代码来源:WebAii.cs


注:本文中的Manager.LaunchNewBrowser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。