本文整理汇总了C#中ISelenium.GetTitle方法的典型用法代码示例。如果您正苦于以下问题:C# ISelenium.GetTitle方法的具体用法?C# ISelenium.GetTitle怎么用?C# ISelenium.GetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISelenium
的用法示例。
在下文中一共展示了ISelenium.GetTitle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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"));
}
示例2: 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']");
}
示例3: Home
/// <summary>
/// Instantiates a new Home Page object. Pass in the Selenium object created in the test SetUp().
/// When the object in instantiated it will navigate to the root
/// </summary>
/// Selenium Object created in the tests
public Home(ISelenium selenium)
{
this._selenium = selenium;
if (!selenium.GetTitle().Contains("home"))
{
selenium.Open("/");
}
selenium.WindowMaximize();
}
示例4: 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
}
}
示例5: setupBrowser
private void setupBrowser()
{
// NOTE: These base URLs only work for systems who happen to have the same integration and localhost suffix (For example, localhost/RlePersonnel and integration.redstapler.biz/RlePersonnel).
// Systems like MITCalendar will not work until we come up with a better solution.
// NOTE: This should not be hard-coded.
var baseUrl = "https://integration.redstapler.biz/";
if( ConfigurationStatics.IsDevelopmentInstallation ) {
if( ConfigurationStatics.InstallationConfiguration.WebApplications.Any( wa => wa.SupportsSecureConnections ) )
baseUrl = "https://localhost/";
else
baseUrl = "http://localhost/";
}
selenium = new DefaultSelenium( "localhost" /*location of Selenium server*/, 4444, @"*firefox3 C:\Program Files (x86)\Mozilla Firefox\firefox.exe", baseUrl );
selenium.Start();
if( ConfigurationStatics.IsIntermediateInstallation ) {
executeSeleniumBlock(
"Intermediate log on",
delegate {
// NOTE: We need to go to the specific URL here instead of relying on a redirect, or Selenium will time out or otherwise fail (it sucks at following redirects).
selenium.Open( "/" + ConfigurationStatics.InstallationConfiguration.SystemShortName + "/Ewf/IntermediateLogIn.aspx?ReturnUrl=" );
// NOTE: Does not work for MIT Calendar, etc.
selenium.Type( "ctl00_ctl00_main_contentPlace_ctl12_theTextBox", ConfigurationStatics.SystemGeneralProvider.IntermediateLogInPassword );
// NOTE: Move g8Summit to machine configuration file.
SubmitForm( selenium );
selenium.WaitForPageToLoad( "30000" );
} );
}
if( UserManagementStatics.UserManagementEnabled && FormsAuthStatics.FormsAuthEnabled ) {
executeSeleniumBlock(
"Forms log on",
delegate {
// NOTE: System-name approach suffers from same problem as above.
selenium.Open( "/" + ConfigurationStatics.InstallationConfiguration.SystemShortName + "/Ewf/UserManagement/LogIn.aspx?ReturnUrl=" );
// NOTE: I don't think we need waits after opens.
selenium.WaitForPageToLoad( "30000" );
Assert.IsTrue( selenium.GetTitle().EndsWith( "Log In" ) );
// NOTE: For RSIS, we need the ability to pass a different email address and a different password for testing.
selenium.Type( "ctl00_ctl00_main_contentPlace_emailAddress_theTextBox", ConfigurationStatics.SystemGeneralProvider.FormsLogInEmail );
selenium.Type( "ctl00_ctl00_main_contentPlace_password_theTextBox", ConfigurationStatics.SystemGeneralProvider.FormsLogInPassword );
SubmitForm( selenium );
selenium.WaitForPageToLoad( "30000" );
} );
}
}