本文整理汇总了C#中ISelenium.Type方法的典型用法代码示例。如果您正苦于以下问题:C# ISelenium.Type方法的具体用法?C# ISelenium.Type怎么用?C# ISelenium.Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISelenium
的用法示例。
在下文中一共展示了ISelenium.Type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupClass
public void SetupClass()
{
base.StartServer();
selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["baseUrl"]);
selenium.Start();
verificationErrors = new StringBuilder();
selenium.DeleteAllVisibleCookies();
selenium.Open("/dna/mbfood/");
// To Do
// too general, could crash test if a topic happened to have the wrong name
Assert.IsFalse(selenium.IsTextPresent("error"));
Assert.IsFalse(selenium.IsTextPresent("There has been a problem"));
selenium.Click("link=Sign in");
selenium.Click("bbcid_username");
selenium.Type("bbcid_username", "mpgsuper");
selenium.Type("bbcid_password", "ratbags");
selenium.Click("signin");
selenium.WaitForPageToLoad("30000");
// going this way so as to be certain to get the right site options without thinking about it
selenium.Click("link=Site Options");
selenium.WaitForPageToLoad("30000");
// check a) where we are b) BBC site requirements for page titles https://confluence.dev.bbc.co.uk/display/DNA/Meta+Data - note that this title breaks those guidelines
Assert.AreEqual("BBC - Food - DNA Administration - Site Options - Food", selenium.GetTitle());
Assert.IsTrue(selenium.IsElementPresent("//input[@name='sov_49_General_CustomBarlesquePath']");
stateOfOption = selenium.GetValue("//input[@name='so_49_General_CustomBarlesquePath' and @type='radio' and @checked='']/@value");
valueOfOption = selenium.GetValue("//input[@name='so_49_General_CustomBarlesquePath' and @type='text']");
}
示例2: Init
public void Init()
{
//Deleting cookies in ie browser through command line.
/*var procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2");
var proc = new System.Diagnostics.Process { StartInfo = procStartInfo };
proc.Start();
WebDriverObj = new InternetExplorerDriver();
*/
string URL = "https://stg-gib.ladbrokes.com/admin";
WebDriverObj = new FirefoxDriver();
MyBrowser = new WebDriverBackedSelenium(WebDriverObj, URL);
MyBrowser.Start();
WebDriverObj.Manage().Window.Maximize();
MyBrowser.WindowMaximize();
MyBrowser.Open(URL);
MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
MyBrowser.Refresh();
MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
MyBrowser.Type(TestDataCreation.ControlsRepository.UsrNmeTxtBx, "Automation1");
MyBrowser.Type(TestDataCreation.ControlsRepository.PwdTxtBx, "aditi123");
MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
MyBrowser.Click(TestDataCreation.ControlsRepository.LoginBtn);
MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
}
示例3: SetupTest
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/");
selenium.Start();
verificationErrors = new StringBuilder();
selenium.Open("/");
selenium.Type("id=loginPassword", "lex");
selenium.Type("id=loginUsername", "lex");
selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
selenium.WaitForPageToLoad("30000");
}
示例4: Login
public void Login()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/");
selenium.Start();
selenium.Open("/");
selenium.Type("id=loginUsername", "lex");
selenium.Type("id=loginPassword", "lex");
selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
selenium.WaitForPageToLoad("30000");
selenium.Click("//a[contains(@href, 'UserActivity/Index')]");
selenium.WaitForPageToLoad("30000");
}
示例5: Init
public void Init()
{
FfDriver = new FirefoxDriver();
MyBrowser = new WebDriverBackedSelenium(FfDriver, "https://stg-gib.ladbrokes.com/admin");
MyBrowser.Start();
MyBrowser.Open("https://stg-gib.ladbrokes.com/admin");
MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.UsrNmeTxtBx, "sanjeeva_p");
MyBrowser.Type(AdminSuite.CommonControls.AdminHomePage.PwdTxtBx, "123456");
MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
MyBrowser.Click(AdminSuite.CommonControls.AdminHomePage.LoginBtn);
MyBrowser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
}
示例6: Login
public void Login()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["SELENIUM_URL"]);
selenium.Start();
selenium.Open("/");
selenium.Type("id=loginUsername", "prof");
selenium.Type("id=loginPassword", "prof");
selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
selenium.WaitForPageToLoad("40000");
selenium.Click("link=Courses");
selenium.WaitForPageToLoad("40000");
}
示例7: Login
public void Login()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:1556/");
selenium.Start();
selenium.Open("/");
selenium.Type("id=loginUsername", "prof");
selenium.Type("id=loginPassword", "prof");
selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
selenium.WaitForPageToLoad("30000");
selenium.Click("link=Courses");
selenium.WaitForPageToLoad("30000");
}
示例8: Login
public void Login()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", ConfigurationManager.AppSettings["SELENIUM_URL"]);
selenium.Start();
selenium.Open("/");
selenium.Type("id=loginUsername", "lex");
selenium.Type("id=loginPassword", "lex");
selenium.Click("//div[@id='logindisplay']/form[2]/input[3]");
selenium.WaitForPageToLoad("30000");
selenium.Click("//a[contains(@href, 'UserActivity/Index')]");
selenium.WaitForPageToLoad("30000");
}
示例9: Google_For_SimpleTalk
public void Google_For_SimpleTalk(SeleniumProvider seleniumProvider)
{
Browser = seleniumProvider.GetBrowser();
Browser.Open("/");
Browser.Type("q", "Simple Talk");
Browser.Click("btnG");
Browser.WaitForPageToLoad("3000");
Assert.True(Browser.IsTextPresent("www.simple-talk.com"));
}
示例10: TestMethod3
public void TestMethod3()
{
string URL = "http://www.abb.com";
selenium = new DefaultSelenium("localhost", 4444, "*firefox", URL);
selenium.Start();
selenium.Open("/");
Assert.AreEqual("The ABB Group - Automation and Power Technologies", selenium.GetTitle());
selenium.Type("searchInput", "Robot");
selenium.Click("search");
selenium.WaitForPageToLoad("10000");
Assert.AreEqual("The ABB Group", selenium.GetTitle());
Assert.AreEqual("Robot", selenium.GetValue("searchInput"));
}
示例11: CaptureLoginErrorMessage
///<summary>
/// This method captures the error message displayed when attempts to login with invalid credentials
/// <example>CaptureLoginErrorMessage(browser, "ecomm_test_user", "123456")</example>
public string CaptureLoginErrorMessage(ISelenium browser, string userName, string password)
{
try
{
IWebDriver driver = ((WebDriverBackedSelenium)browser).UnderlyingWebDriver;
LFcommonObj.selectMenuButton(browser);
LFcommonObj.clickObject(browser, LoginLogoutControls.loginOrRegisterLink);
LFframeworkCommonObj.WaitUntilElementEditable(browser, LoginLogoutControls.loginUsernameTextBox, "10000");
Assert.IsTrue(browser.IsVisible(LoginLogoutControls.loginBanner), "Login page not displayed");
Assert.IsTrue(browser.IsVisible(LoginLogoutControls.loginUsernameTextBox), "Username field not presesnt in Login page");
Assert.IsTrue(browser.IsVisible(LoginLogoutControls.loginPasswordTextBox), "Password field not presesnt in Login page");
browser.Type(LoginLogoutControls.loginUsernameTextBox, "");
if (userName != null)
{
browser.Type(LoginLogoutControls.loginUsernameTextBox, userName);
}
browser.Type(LoginLogoutControls.loginPasswordTextBox, "");
if (password != null)
{
browser.Type(LoginLogoutControls.loginPasswordTextBox, password);
}
browser.FireEvent(LoginLogoutControls.loginSubmitButton, "click");
LFcommonObj.WaitForLoadingIcon(browser, FrameGlobals.IconLoadTimeout);
Thread.Sleep(1000);
return driver.FindElement(By.XPath(LoginLogoutControls.loginErrorpanel)).Text;
}
catch (Exception ex)
{
Console.WriteLine("Function 'CaptureLoginErrorMessage' - Failed");
Console.WriteLine(ex.Message);
Fail(ex.Message);
return null;
}
}
示例12: TestMethod1
public void TestMethod1()
{
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.google.com/");
selenium.Start();
selenium.Open("/");
selenium.Type("q", "selenium rc");
selenium.Click("btnG");
selenium.WaitForPageToLoad("30000");
Assert.AreEqual("selenium rc - Google Search", selenium.GetTitle());
try
{
selenium.Stop();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
}
示例13: TestMethod2
public void TestMethod2()
{
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost:1987");
selenium.Start();
selenium.Open("/WebSite1/");
selenium.Type("MainContent_TextBox1", "HUM");
selenium.Click("MainContent_Button1");
selenium.WaitForPageToLoad("3000770");
//Get the Table Value of Row 1 and Coulumn 2
object GG = selenium.GetTable("MainContent_GridView1.1.2");
Assert.AreEqual("1", "1");
try
{
selenium.Stop();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
}
示例14: VerifySelectionData
/// <summary>
/// Verifying selection data
/// </summary>
/// <param name="browser">Browser instance</param>
/// <param name="testData">TestData</param>
public void VerifySelectionData(ISelenium browser, TestData testData)
{
string selectionStatus = string.Empty;
string selectionDisplay = string.Empty;
string selectionPrice = string.Empty;
bool updateSelectionFlg = false;
if (_frameworkCommon.WaitUntilElementPresent(browser, "name=OcDesc", "60") == true)
{
selectionStatus = browser.GetValue(AdminSuite.CommonControls.EventDetailsPage.SelectionStatusLstBx);
selectionDisplay = browser.GetValue(AdminSuite.CommonControls.EventDetailsPage.SelectionDispStatusListBx);
selectionPrice = browser.GetValue(AdminSuite.CommonControls.EventDetailsPage.PriceTxtBx);
if ("a" != selectionStatus.ToLower())
{
browser.Select(AdminSuite.CommonControls.EventDetailsPage.SelectionStatusLstBx, "label=Active");
Console.WriteLine("Updated selection status to Active");
updateSelectionFlg = true;
}
if ("y" != selectionDisplay.ToLower())
{
browser.Select(AdminSuite.CommonControls.EventDetailsPage.SelectionDispStatusListBx, "label=Yes");
Console.WriteLine("Updated selection display to Yes");
updateSelectionFlg = true;
}
if (testData.Odds != selectionPrice)
{
browser.Type(AdminSuite.CommonControls.EventDetailsPage.PriceTxtBx, testData.Odds);
Console.WriteLine("Updated selection price from test data");
updateSelectionFlg = true;
}
if (updateSelectionFlg)
{
if (browser.IsElementPresent(AdminSuite.CommonControls.EventDetailsPage.SelectionUpdateBtn))
{
browser.Click(AdminSuite.CommonControls.EventDetailsPage.SelectionUpdateBtn);
browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
}
else
{
Console.WriteLine("Unable to update the event in Openbet");
}
Thread.Sleep(3000);
}
browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
}
}
示例15: UpdateSelectionDisplayStatus
/// <summary>
/// To update the Selection
/// </summary>
/// <param name="browser">Selenium browser Instance</param>
/// <param name="selectionId">ID of the selection</param>
/// <param name="status"> Display Status to be updated</param>
public void UpdateSelectionDisplayStatus(ISelenium browser, string selectionId, string displayStatus)
{
//Clicking on Event Link in LHN
LHNavigation(AdminSuite.CommonControls.AdminHomePage.EventNameLink, browser);
//Selecting TopFrame
SelectMainFrame(browser);
browser.Type(AdminSuite.CommonControls.AdminHomePage.OpenBetIdTextBox, selectionId);
browser.Select(AdminSuite.CommonControls.AdminHomePage.OpenBetHierarchyLevelDrpLst, AdminSuite.CommonControls.AdminHomePage.OpenBetHeierarchyName);
browser.Click(AdminSuite.CommonControls.AdminHomePage.EventFindBtn);
browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
if (String.IsNullOrWhiteSpace(displayStatus) == false)
{
browser.Select(AdminSuite.CommonControls.EventDetailsPage.SelectionDispStatusListBx, "label=" + displayStatus + "");
}
else
{
Fail("unable to update the Displayed status in admin as Displayed list box is not present in admin");
}
// Updating the event details page
browser.Click(AdminSuite.CommonControls.EventDetailsPage.SelectionUpdateBtn);
browser.WaitForPageToLoad(Framework.FrameGlobals.PageLoadTimeOut);
}