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


C# IBrowser.Navigate方法代码示例

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


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

示例1: SetUp

 public void SetUp()
 {
     #region Create and start browser
     browserType = BrowserType.Chrome;
     browser = BrowserFactory.Launch(browserType);
     browser.Navigate(baseUri);
     appModel = new AOBModel(browser);
     #endregion
 }
开发者ID:panama69,项目名称:AOB_LeanFTv1,代码行数:9,代码来源:LeanFtTest.cs

示例2: TestFixtureSetUp

        public void TestFixtureSetUp()
        {
            // Setup once per fixture

            // Optional to turn on snapshots on every step.  It can be set here this way
            // or by making modifications to the App.config file
            Reporter.SnapshotCaptureLevel = HP.LFT.Report.CaptureLevel.All;

            // Initially create an instance of the browser and navigate to the AdVantage home page
            AdVantBrowser = BrowserFactory.Launch(BrowserType.InternetExplorer);
            AdVantBrowser.Navigate("http://alm-aob:47001/advantage/");
            //AdVantBrowser.Navigate("http://15.126.221.115:47001/advantage/");

            // Create a new instance of the Application Model

            MyVantModel = new VantModel(AdVantBrowser);
        }
开发者ID:coreydaj,项目名称:LeanFT,代码行数:17,代码来源:LeanFtTest.cs

示例3: BrowserInitialize

		private Task BrowserInitialize(IBrowser browser, string icn, CancellationToken ct)
		{
			return Task.Run(async () =>
			{
				await browser.Navigate(ModuleConfiguration.Url, ct);
				do
				{
					var isJquery = (bool)await browser.ExecuteJs("return jQuery != null", ct);
					if (isJquery)
						break;

					await browser.Refresh(ct);
				} while (true);

				await browser.ExecuteJs(
					"window.fragma=window.fragma||{},fragma.modules=fragma.modules||{},void 0===fragma.modules.cities&&(fragma.modules.cities=new function(){var e=this,t=function(e,t,i,n,r){i.hide(),t.val(e),t.keydown();var a=[],o=function(){return i.is(':visible')?$.each(i.find('a'),function(e,t){var i=$(t);a.push(i.html())}):t.val()!=e&&a.push(t.val()),a.length>0?(n.waitHandler=null,void r(a)):void(n.waitHandler=setTimeout(o,100))};n.waitHandler=setTimeout(o,30)};e.senderContext={cities:[],waitHandler:null},e.receiverContext={cities:[],waitHandler:null},e.getSenderCity=function(i){e.senderContext.cities=[],e.senderContext.waitHandler&&(clearTimeout(e.senderContext.waitHandler),e.senderContext.waitHandler=null);var n=$('input[name=\"from_ship\"]'),r=$($('ul.ui-autocomplete')[0]);t(i,n,r,e.senderContext,function(t){e.senderContext.cities=t})},e.getReceiverCity=function(i){e.receiverContext.cities=[],e.receiverContext.waitHandler&&(clearTimeout(e.receiverContext.waitHandler),e.receiverContext.waitHandler=null);var n=$('input[name=\"to_send\"]'),r=$($('ul.ui-autocomplete')[1]);return t(i,n,r,e.receiverContext,function(t){e.receiverContext.cities=t})}});",
					ct);

				await browser.ExecuteJs(
					"window.fragma=window.fragma||{},fragma.modules=fragma.modules||{},void 0===fragma.modules.tariffs&&(fragma.modules.tariffs=new function(){var a=this;a.getTariffs=function(){for(var a=[],n=$('.style_table').find('tr'),r=1;r<n.length;++r){var f=$(n[r]);$columns=f.find('td');var s=$columns[0].innerHTML,m=$($columns[1]).find('b').html(),i=$columns[2].innerHTML;a.push(s),a.push(m),a.push(i)}return a}});",
					ct);

				if (!await browser.Select("input[name='login']", ct))
					throw new InvalidOperationException("Can't find login input");
				await browser.Input(ModuleConfiguration.Login, ct);

				if (!await browser.Select("input[name=pass]", ct))
					throw new InvalidOperationException("Can't find password input");
				await browser.Input(ModuleConfiguration.Password, ct);

				if (!await browser.WaitForAjax(5000, ct))
					throw new TimeoutException("Failed to wait for icn input to show");

				//await WaitFor("Failed to wait for icn input to show", 20, () =>
				//{
				//    return _browser.IsElementVisible("div#loginform input[name=icn]", ct);
				//}, ct);

				if (!await browser.Select("input[name=icn]", ct))
					throw new InvalidOperationException("Can't find icn input");
				await browser.Input(icn, ct);
				await browser.Select("#submit", ct);

				if (!await browser.WaitForAjax(10000, ct))
					throw new TimeoutException("Login operation proceeded too long");
			}, ct);
		}
开发者ID:FragmaYOla,项目名称:TariffMeter,代码行数:47,代码来源:SPSRTariffsProvider.cs


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