This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(integerEntered >= 1 && integerEntered <= 5) | |
DisplayMessage(“Success”); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NUnit.Framework; | |
using OpenQA.Selenium.Firefox; | |
namespace ParallelLocal | |
{ | |
[TestFixture] | |
public class ParallelLocal | |
{ | |
[Test] | |
public void Test1() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NUnit.Framework; | |
using OpenQA.Selenium.Firefox; | |
namespace ParallelLocal | |
{ | |
[TestFixture] | |
[Parallelizable] | |
public class ParallelLocal | |
{ | |
[Test] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
[Parallelizable] | |
public class BrowserstackTest2 | |
{ | |
private IWebDriver driver; | |
[SetUp] | |
public void Init() | |
{ | |
DesiredCapabilities capability = DesiredCapabilities.Firefox(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NUnit.Framework; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Remote; | |
namespace ParallelTestingBrowserStack | |
{ | |
[TestFixture] | |
[Parallelizable] | |
public class BrowserstackTest1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NUnit.Framework; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Remote; | |
namespace SauceLabsParallelTests | |
{ | |
[TestFixture("chrome", "39", "Windows 7", "", "")] | |
[Parallelizable] | |
public class SauceNUnitTest2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UnitTest1 | |
{ | |
private IWebDriver _driver; | |
[TestInitialize] | |
public void Setup() | |
{ | |
//LocalInitialize(); | |
BasicInitialize(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//EXAMPLE 1 - This is the most convenient method provided to us by the Webdriver API | |
//ExpectedConditions class provides us many different options for locating an element | |
var wait = new WebDriverWait(_driver,TimeSpan.FromSeconds(10)); | |
wait.Until(ExpectedConditions.ElementIsVisible(By.Id("elementId"))); | |
//EXAMPLE 2 - This is a wait that dynamically checks for the presence of an element for a maximum amount of time, a bit burdensome | |
//because we had to write it | |
IWebDriver driver = new FirefoxDriver(); | |
driver.Url = "http://somedomain/url_that_delays_loading"; | |
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _driver = new FirefoxDriver(); | |
_driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//find the element that has the text Hello World | |
var text = _driver.FindElement(By.XPath(".//*[contains(text(),'Hello World!')]")); |
OlderNewer