本文整理汇总了C#中ISelenium类的典型用法代码示例。如果您正苦于以下问题:C# ISelenium类的具体用法?C# ISelenium怎么用?C# ISelenium使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISelenium类属于命名空间,在下文中一共展示了ISelenium类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: clickObjectInColl
///<summary>
/// This method selects an object in a collection(button, link)
/// <example>clickObjectInColl(browser, xPath, elementName)</example>
public void clickObjectInColl(ISelenium browserObj, string strLocator, string elementName)
{
IWebDriver driver = ((WebDriverBackedSelenium)browserObj).UnderlyingWebDriver;
try
{
Thread.Sleep(1000);
ReadOnlyCollection<IWebElement> element = driver.FindElements(By.XPath(strLocator));
for (int i = 0; i < element.Count; i++)
{
if (element[i].Text.ToLower().Trim() == elementName.ToLower().Trim())
{
element[i].Click();
break;
}
else
{
if (i == element.Count - 1)
{
Fail(elementName + " object was not found");
}
}
}
WaitForLoadingIcon(browserObj, Convert.ToInt32(FrameGlobals.IconLoadTimeout + 5000));
}
catch (Exception ex)
{
Console.WriteLine("Function 'clickObject' - Failed");
Console.WriteLine(ex.Message);
Fail(ex.Message);
}
}
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:34,代码来源:Common.cs
示例2: EventStatusValidation
/// <summary>
/// Method to update and validate event status validations
/// </summary>
public void EventStatusValidation(ISelenium browser, ISelenium adminBrowser,TestData testData, string navPanel)
{
string eventStatus, updatedStatus;
string alternateStatus = "Suspended";
try
{
#region Event Status validation
eventStatus = GetEventStatus(browser, testData.ClassName, navPanel, testData);
if (eventStatus == "Suspended")
alternateStatus = "Active";
adminCommonObj.UpdateEvents(adminBrowser, testData.CategoryName, testData.ClassName, testData.TypeName, testData.SubTypeName, testData.EventName, alternateStatus);
Thread.Sleep(FrameGlobals.OpenBetReflectTimeOut);
Console.WriteLine("Event status is updated in admin");
updatedStatus = GetEventStatus(browser, testData.ClassName, navPanel, testData);
Assert.IsFalse(Equals(eventStatus, updatedStatus), "Event status is not updated on the page");
#endregion
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
CaptureScreenshot(browser, "EventStatusValidation");
}
}
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:31,代码来源:HorseRacingFuntions.cs
示例3: VerifyContactusPage
///<summary>
/// This method verifies the details on COntact Us page
/// <example>VerifyContactusPage(MyBrowser)</example>
public void VerifyContactusPage(ISelenium browser)
{
try
{
HGFcommonObj.selectMenuButton(browser);
HGFcommonObj.clickObject(browser, LoginLogoutControls.loginOrRegisterLink);
Thread.Sleep(1000);
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.lostLoginButton), "Lost Login button is not present in mobile's login page");
HGFcommonObj.clickObject(browser, LoginLogoutControls.lostLoginButton);
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.contactUsBanner), "'Contact us' banner is not present in the Contact Us page");
Assert.IsTrue(browser.IsTextPresent("To speak to our 24 hour Customer Support team please contact us on:"), "Contact Us message is not present in the Contact Us page");
Assert.IsTrue(browser.IsTextPresent("Call us on:"), "'Call us on' message is not present in the Contact Us page");
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.UKContacts), "UK contact details are not not present in the Contact Us page");
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.NonUKContacts), "Non UK contact details are not not present in the Contact Us page");
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.emailContacts), "eMail information is not present in the Contact Us page");
Console.WriteLine("UI Verification of Contact us page via 'Lost Login' was successful");
HGFcommonObj.SelectLinksFromSideBar(browser, "Contact us", "Contact Us");
Assert.IsTrue(browser.IsTextPresent("To speak to our 24 hour Customer Support team please contact us on:"), "Contact Us message is not present in the Contact Us page");
Assert.IsTrue(browser.IsTextPresent("Call us on:"), "'Call us on' message is not present in the Contact Us page");
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.UKContacts), "UK contact details are not not present in the Contact Us page");
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.NonUKContacts), "Non UK contact details are not not present in the Contact Us page");
Assert.IsTrue(browser.IsElementPresent(LoginLogoutControls.emailContacts), "eMail information is not present in the Contact Us page");
Console.WriteLine("UI Verification of Contact us page via 'Side Menu' was successful");
}
catch (Exception ex)
{
Console.WriteLine("Function 'VerifyContactusPage' - Failed");
Console.WriteLine(ex.Message);
Fail(ex.Message);
}
}
开发者ID:hemap,项目名称:PhoenixAutomationRepo,代码行数:37,代码来源:HomeGlobalFunctions.cs
示例4: Security
public Security(ISelenium selenium)
{
this.selenium = selenium;
Login();
SwitchToSecurity();
ClickBanUnban();
}
开发者ID:supermuk,项目名称:iudico,代码行数:7,代码来源:Security.cs
示例5: JavaSelenium
public JavaSelenium(ISelenium pSelenium, string pObjectID)
{
_selenium = pSelenium;
_objectID = pObjectID;
_selenium.Start();
_SetJSPrefix();
}
开发者ID:codehaus,项目名称:fest-git,代码行数:8,代码来源:JavaSelenium.cs
示例6: 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();
}
开发者ID:AutomatedTester,项目名称:Presentations,代码行数:14,代码来源:Home.cs
示例7: Silvernium
public Silvernium(ISelenium selenium, string silverlightObjectId, string scriptKey)
{
if (!string.IsNullOrEmpty(scriptKey))
{
this.scriptKey = scriptKey + ".";
}
this.selenium = selenium;
silverLightJSStringPrefix = GetSilverLightJSStringPrefix(silverlightObjectId);
}
开发者ID:kasq,项目名称:silverlight-selenium,代码行数:9,代码来源:Silvernium.cs
示例8: LaunchBrowser
/// <summary>
/// Launches the Selenium RC and browser specified in the Environments.cs file
/// </summary>
public ISelenium LaunchBrowser(ISelenium browser)
{
browser = new DefaultSelenium(this.environment.host, this.environment.port, this.environment.browser, this.environment.baseURL);
browser.Start();
browser.SetTimeout(this.environment.timeout);
browser.WindowMaximize();
browser.WindowFocus();
return browser;
}
开发者ID:tmacblane,项目名称:TestManager,代码行数:13,代码来源:WebBrowser.cs
示例9: GetCurrentSelenium
public ISelenium GetCurrentSelenium()
{
if (selenium == null)
{
selenium = new WebDriverBackedSelenium(StartDriver(), "http://localhost:" + this.port.ToString() + "/selenium-server/tests");
selenium.Start();
}
return selenium;
}
开发者ID:RanchoLi,项目名称:selenium,代码行数:10,代码来源:EnvironmentManager.cs
示例10: SetupTest
public void SetupTest()
{
HttpCommandProcessor processor = new HttpCommandProcessor();
DefaultBrowserLauncher launcher = new DefaultBrowserLauncher();
selenium = new DefaultSelenium(processor, launcher);
selenium.Start();
}
开发者ID:santiycr,项目名称:selenium,代码行数:7,代码来源:SeleniumIntegrationTest.cs
示例11: SetupTest
public void SetupTest()
{
url = "http://localhost:52994/";
selenium = new DefaultSelenium("localhost", 4444, "*chrome", url);
selenium.Start();
verificationErrors = new StringBuilder();
}
开发者ID:kilonet,项目名称:elfam,代码行数:7,代码来源:CategoryTest.cs
示例12: SetupTest
public void SetupTest()
{
//selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://maps.google.com/");
selenium = new DefaultSelenium("localhost", 5555, "*iexplore", "https://maps.google.com/");
selenium.Start();
verificationErrors = new StringBuilder();
}
开发者ID:CodeCowboyOrg,项目名称:SeleniumTestExamples,代码行数:7,代码来源:SeleniumGoogleMapsRemoteControl.cs
示例13: GetDriver
//Start the browser depending on the setting
public void GetDriver(WebBrowsers webBrws)
{
WebBrws = webBrws;
if (webBrws == WebBrowsers.Ie)
{
//Secutiry setting for IE
var capabilitiesInternet = new InternetExplorerOptions { IntroduceInstabilityByIgnoringProtectedModeSettings = true };
Driver = new InternetExplorerDriver(capabilitiesInternet);
}
else
if (webBrws == WebBrowsers.FireFox)
{
//FirefoxBinary binary = new FirefoxBinary(@"C:\Program Files (x86)\Mozilla Firefox\firefox.exe");
FirefoxProfile profile = new FirefoxProfile();
// profile.SetPreference("webdriver.firefox.bin", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
Driver = new FirefoxDriver(profile);
}
else
if (webBrws == WebBrowsers.Chrome)
{
//Chrome driver requires the ChromeDriver.exe
Driver = new ChromeDriver(@"..\..\..\lib\BrowserDriver\Chrome");
}
else { throw new WebDriverException(); }
Selenium = new WebDriverBackedSelenium(Driver, BaseUrl);
}
开发者ID:ectechno,项目名称:seshell,代码行数:28,代码来源:BaseClass.cs
示例14: SetUp
public void SetUp()
{
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", URL);
selenium.Start();
selenium.Open(URL);
silvernium = new Silvernium(selenium, OBJECTID, SCRIPTKEY);
}
开发者ID:kasq,项目名称:silverlight-selenium,代码行数:7,代码来源:SilverNibblesTest.cs
示例15: MyTestInitialize
public void MyTestInitialize()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://login.live.com/");
selenium.Start();
selenium.SetSpeed("800");
verificationErrors = new StringBuilder();
}
开发者ID:CodeCowboyOrg,项目名称:SeleniumTestExamples,代码行数:7,代码来源:SeleniumMsTestLiveAccountLogin2.cs
示例16: SetupTest
public virtual void SetupTest()
{
proc = new HttpCommandProcessor("localhost", 4444, "*chrome", _3DR_Testing.Properties.Settings.Default._3DRURL);
selenium = new DefaultSelenium(proc);
verificationErrors = new StringBuilder();
selenium.Start();
}
开发者ID:jamjr,项目名称:3D-Repository,代码行数:7,代码来源:NewUploadTest.cs
示例17: Start
public void Start()
{
this.selenium = new DefaultSelenium("localhost", 4444,
"*firefox", ConfigurationManager.AppSettings["SELENIUM_URL"]);
this.selenium.Start();
this.verificationErrors = new StringBuilder();
}
开发者ID:supermuk,项目名称:iudico,代码行数:7,代码来源:SecuritySeleniumTester.cs
示例18: 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']");
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:33,代码来源:CustomBarlesque.cs
示例19: SetupTest
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", UpgradeSeleniumTester.browserURL);
selenium.Start();
verificationErrors = new StringBuilder();
}
开发者ID:supermuk,项目名称:iudico,代码行数:7,代码来源:UniqueUserId.cs
示例20: SetUp
public void SetUp()
{
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost");
selenium.Start();
selenium.Open("http://localhost");
silvernium = new Silvernium(selenium, "Test");
}
开发者ID:kasq,项目名称:silverlight-selenium,代码行数:7,代码来源:SilverniumIntegrationTests.cs
注:本文中的ISelenium类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论