本文整理匯總了C#中WatiN.Core.IE.BringToFront方法的典型用法代碼示例。如果您正苦於以下問題:C# IE.BringToFront方法的具體用法?C# IE.BringToFront怎麽用?C# IE.BringToFront使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WatiN.Core.IE
的用法示例。
在下文中一共展示了IE.BringToFront方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Home_HasMvcStoreHasTitle_True
public void Home_HasMvcStoreHasTitle_True()
{
var browser = new IE("http://localhost:1100/");
browser.BringToFront();
Assert.IsTrue(browser.ContainsText("ASP.NET MVC MUSIC STORE"));
browser.Close();
}
示例2: Home_ClickOnRockContainsRockAlbumText_True
public void Home_ClickOnRockContainsRockAlbumText_True()
{
using (var browser = new IE("http://localhost:1100/"))
{
browser.BringToFront();
browser.Link(Find.ByText("Rockssss")).Click();
Assert.IsTrue(browser.ContainsText("Rock Albums"));
}
}
示例3: OpenIEInstance
/// <summary>
/// Opens a new IE instance with the given settings in front of other windows that are currently open.
/// </summary>
/// <param name="targetURL">The URL that the IE instance should browse to.</param>
/// <param name="silentMode">If true the test will be run without displaying any IE instance or steps.</param>
/// <param name="timeOut">The default time out to use when calling IE.AttachToIE(findby).</param>
/// <param name="autoCloseIE">If true when a reference to the IE instance is destroyed the actual window will close.</param>
/// <param name="movePointer">It true the mouse pointer will move to the top left corner of the screen when a new IE instance is created.</param>
/// <returns>The new IE instance.</returns>
public static IE OpenIEInstance(string targetURL, bool silentMode, int timeOut, bool autoCloseIE, bool movePointer)
{
Settings.MakeNewIeInstanceVisible = !silentMode;
Settings.WaitForCompleteTimeOut = timeOut;
Settings.WaitUntilExistsTimeOut = timeOut;
Settings.AttachToBrowserTimeOut = timeOut;
Settings.AutoMoveMousePointerToTopLeft = movePointer;
IE ieInstance = new IE { AutoClose = autoCloseIE };
if(!silentMode) ieInstance.ShowWindow(NativeMethods.WindowShowStyle.ShowMaximized);
ieInstance.BringToFront();
ieInstance.GoTo(targetURL);
return ieInstance;
}
示例4: Adding_Items_ToCart
public void Adding_Items_ToCart()
{
using (var browser = new IE())
{
browser.GoTo("http://localhost:1100/");
browser.BringToFront();
browser.Link(Find.ByText("Pop")).Click();
browser.Link(Find.ByText("Frank")).Click();
browser.Link(Find.ByText("Add to cart")).Click();
Assert.IsTrue(browser.ContainsText("8.99"));
}
}
示例5: SimpleJavaAlertHandler
public void SimpleJavaAlertHandler()
{
WatiN.Core.Settings.AutoMoveMousePointerToTopLeft = false;
WatiN.Core.Settings.MakeNewIeInstanceVisible = true;
using(WatiN.Core.IE ie = new IE(Path.Combine(System.Environment.CurrentDirectory, "testpage1.htm")))
{
ie.BringToFront();
Assert.AreEqual("Alert test", ie.Link("linkAlert").Text);
WatiN.Core.DialogHandlers.SimpleJavaDialogHandler handler = new SimpleJavaDialogHandler();
ie.DialogWatcher.Add(handler);
ie.Link("linkAlert").Click();
Assert.AreEqual("This is an alert message", handler.Message);
}
}
示例6: ConfirmJavaDialogHandler
public void ConfirmJavaDialogHandler()
{
WatiN.Core.Settings.AutoMoveMousePointerToTopLeft = false;
WatiN.Core.Settings.MakeNewIeInstanceVisible = true;
using (WatiN.Core.IE ie = new IE(Path.Combine(System.Environment.CurrentDirectory, "testpage1.htm")))
{
ie.BringToFront();
WatiN.Core.DialogHandlers.ConfirmDialogHandler handler = new ConfirmDialogHandler();
ie.DialogWatcher.Add(handler);
ie.Link("linkConfirm").ClickNoWait();
handler.WaitUntilExists(2000);
Assert.AreEqual("Continue", handler.Message);
handler.OKButton.Click();
}
}
示例7: RemoveItemsFromCart
public void RemoveItemsFromCart()
{
using (var browser = new IE())
{
browser.GoTo("http://localhost:1100/");
browser.BringToFront();
browser.Link(Find.ByText("Pop")).Click();
browser.Link(Find.ByText("Frank")).Click();
browser.Link(Find.ByText("Add to cart")).Click();
browser.Link(Find.BySelector("a.RemoveLink")).Click();
Assert.IsTrue(browser.ContainsText("0"));
}
}
示例8: Login_Successful_Should_Have_LogOut_Link
public void Login_Successful_Should_Have_LogOut_Link()
{
using (var browser = new IE())
{
browser.GoTo("http://localhost:1100/");
browser.BringToFront();
browser.Link(Find.ByText("Admin")).Click();
//browser.Element(x => x.)
browser.TextField(Find.ById("UserName")).TypeText("administrator");
browser.TextField(Find.ById("Password")).TypeText("password123!");
browser.Element(Find.BySelector("input.LogOn")).Click();
Assert.IsTrue(browser.Link(Find.ByText("Log Out")).Exists);
browser.Link(Find.ByText("Log Out")).Click();
}
}
示例9: Login_UnSuccessful_Should_Have_Error
public void Login_UnSuccessful_Should_Have_Error()
{
var browser = new IE();
browser.GoTo("http://localhost:1100/");
browser.BringToFront();
browser.Link(Find.ByText("Admin")).Click();
browser.TextField(Find.ById("UserName")).TypeText("admin");
browser.TextField(Find.ById("Password")).TypeText("1234");
browser.Element(Find.BySelector("input.LogOn")).Click();
Assert.IsTrue(browser.ContainsText("Login was unsuccessful."));
}
示例10: Login_WithoutUsernameAndPassword_Should_Have_ErrorMessage
public void Login_WithoutUsernameAndPassword_Should_Have_ErrorMessage()
{
using (var browser = new IE())
{
browser.GoTo("http://localhost:1100/");
browser.BringToFront();
browser.Link(Find.ByText("Admin")).Click();
browser.Element(Find.BySelector("input.LogOn")).Click();
Assert.IsTrue(browser.ContainsText("The User name field is required"));
Assert.IsTrue(browser.ContainsText("The Password field is required."));
}
}
示例11: LaunchPageInBrowser
public Result LaunchPageInBrowser(string Url)
{
try
{
browser = new IE(Url);
browser.WaitForComplete();
}
catch (Exception e)
{
Console.WriteLine("BaseFixture.LaunchPageInBrowser: " + e.ToString());
Thread.Sleep(500);
browser = new IE(Url);
browser.WaitForComplete();
}
browser.BringToFront();
browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Maximize);
return Result.CreatePass();
}