└── WebDriverDriverFactory ├── RichardsTestSuite ├── App.config ├── PageObjects │ └── LoginPage.cs ├── Properties │ └── AssemblyInfo.cs ├── RichardsTestSuite.csproj ├── SetUp │ ├── DriverSetup.cs │ ├── TestConfiguration.cs │ └── TestDriverFactory.cs ├── Tests │ └── LoginTests.cs └── packages.config ├── WebDriverDriverFactory.sln ├── WebDriverDriverFactory ├── Configurations │ ├── LocalDriverConfiguration.cs │ └── RemoteDriverConfiguration.cs ├── DriverServices │ ├── IEDriverServer.exe │ ├── chromedriver.exe │ └── phantomjs.exe ├── Properties │ └── AssemblyInfo.cs ├── WebDriverDriverFactory.csproj ├── WebDriverFactory.cs └── packages.config └── packages ├── NUnit.2.6.3 ├── NUnit.2.6.3.nupkg ├── NUnit.2.6.3.nuspec ├── lib │ ├── nunit.framework.dll │ └── nunit.framework.xml └── license.txt ├── Selenium.Support.2.39.0 ├── Selenium.Support.2.39.0.nupkg ├── Selenium.Support.2.39.0.nuspec └── lib │ ├── net35 │ ├── WebDriver.Support.dll │ └── WebDriver.Support.xml │ └── net40 │ ├── WebDriver.Support.dll │ └── WebDriver.Support.xml ├── Selenium.WebDriver.2.39.0 ├── Selenium.WebDriver.2.39.0.nupkg ├── Selenium.WebDriver.2.39.0.nuspec └── lib │ ├── net35 │ ├── WebDriver.dll │ └── WebDriver.xml │ └── net40 │ ├── WebDriver.dll │ └── WebDriver.xml └── repositories.config /WebDriverDriverFactory/RichardsTestSuite/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/PageObjects/LoginPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using OpenQA.Selenium; 7 | using OpenQA.Selenium.Support.UI; 8 | using OpenQA.Selenium.Support.PageObjects; 9 | 10 | namespace RichardsTestSuite.PageObjects 11 | { 12 | /// 13 | /// A PageObject for the Hotmail LoginPage, using the PageObjects suport class. 14 | /// 15 | public class LoginPage 16 | { 17 | /// 18 | /// Note that I have used IWebDriver. 19 | /// As mentioned in the DriverFactory this is because all drivers are contracted to this interface. 20 | /// So if you only use methods available on the Interface, then they will also be available on all drivers. 21 | /// Therefore allowing your page object to be used by any Driver. 22 | /// 23 | private IWebDriver _driver; 24 | 25 | [FindsBy(How = How.Id, Using = "i0116")] 26 | private IWebElement TxtUsername { get; set; } 27 | 28 | [FindsBy(How = How.Id, Using = "i0118")] 29 | private IWebElement TxtPassword { get; set; } 30 | 31 | [FindsBy(How = How.Id, Using = "idSIButton9")] 32 | private IWebElement BtnLogin { get; set; } 33 | 34 | [FindsBy(How = How.Id, Using = "idTd_Tile_ErrorMsg_Login")] 35 | private IWebElement LblLoginErrorMessage { get; set; } 36 | 37 | public LoginPage(IWebDriver driver) 38 | { 39 | _driver = driver; 40 | PageFactory.InitElements(_driver, this); 41 | 42 | WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(10)); 43 | wait.Until(d => d.FindElement(By.Id("i0116")).Displayed); 44 | } 45 | 46 | public void PopulateUsername(string username) 47 | { 48 | TxtUsername.SendKeys(username); 49 | } 50 | 51 | public void PopulatePassword(string password) 52 | { 53 | TxtPassword.SendKeys(password); 54 | } 55 | 56 | public LoginPage ClickLoginExpectingError() 57 | { 58 | BtnLogin.Click(); 59 | return new LoginPage(_driver); 60 | } 61 | 62 | public string ReadLoginErrorMessage() 63 | { 64 | return LblLoginErrorMessage.Text; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RichardsTestSuite")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RichardsTestSuite")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cf7bdddd-ad52-45ca-a038-00fffe2451af")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/RichardsTestSuite.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {25146C22-AAEB-442B-A6B9-FDD69DF56BD8} 8 | Library 9 | Properties 10 | RichardsTestSuite 11 | RichardsTestSuite 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\NUnit.2.6.3\lib\nunit.framework.dll 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ..\packages\Selenium.WebDriver.2.39.0\lib\net40\WebDriver.dll 46 | 47 | 48 | ..\packages\Selenium.Support.2.39.0\lib\net40\WebDriver.Support.dll 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | {86baf6fb-8439-4753-b220-c1c1cb1f571d} 67 | WebDriverDriverFactory 68 | 69 | 70 | 71 | 78 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/SetUp/DriverSetup.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using OpenQA.Selenium; 3 | using RichardsTestSuite.SetUp; 4 | 5 | namespace RichardsTestSuite 6 | { 7 | /// 8 | /// This will Setup a driver instance for us at the start of each Fixture. 9 | /// NUnit will does this because the name space of this class is the highest therefore all tests fall under it. 10 | /// 11 | [SetUpFixture] 12 | public class DriverSetup 13 | { 14 | internal static IWebDriver Driver; 15 | 16 | [SetUp] 17 | public void StartTestServer() 18 | { 19 | Driver = new TestDriverFactory().CreateDriver(); 20 | } 21 | 22 | [TearDown] 23 | public void StopTestServer() 24 | { 25 | Driver.Quit(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/SetUp/TestConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Globalization; 4 | using System.Linq; 5 | using OpenQA.Selenium; 6 | 7 | namespace RichardsTestSuite.SetUp 8 | { 9 | /// 10 | /// Configuration object 11 | /// This would usually also contain other test specific config values required to be read from app.config 12 | /// 13 | public class TestConfiguration 14 | { 15 | public static bool Remote { get; set; } 16 | public static string Browser { get; set; } 17 | public static PlatformType Platform { get; set; } 18 | public static string BrowserVersion { get; set; } 19 | public static string SeleniumHubUrl { get; set; } 20 | public static int SeleniumHubPort { get; set; } 21 | 22 | public static string ApplicationUrl { get; set; } 23 | 24 | //Because this is static it will be executed at the start of any test run. 25 | //Reads the keys from the app.config and assigns them to the properties declared above. 26 | static TestConfiguration() 27 | { 28 | var reader = new AppSettingsReader(); 29 | 30 | Remote = (bool)reader.GetValue("Remote", typeof(bool)); 31 | 32 | Browser = (string)reader.GetValue("Browser", typeof(string)); 33 | 34 | if (Remote) 35 | { 36 | BrowserVersion = (string)reader.GetValue("BrowserVersion", typeof(string)); 37 | Platform = GetPlatformType(); 38 | SeleniumHubUrl = (string)reader.GetValue("SeleniumHubUrl", typeof(string)); 39 | SeleniumHubPort = (int)reader.GetValue("SeleniumHubPort", typeof(int)); 40 | } 41 | 42 | ApplicationUrl = (string)reader.GetValue("ApplicationUrl", typeof(string)); 43 | } 44 | 45 | /// 46 | /// This method converts the OS string in the app.config to the matching value in the PlatformType Enum. 47 | /// 48 | /// A PlatformType instance 49 | private static PlatformType GetPlatformType() 50 | { 51 | var reader = new AppSettingsReader(); 52 | var platformValue = (string)reader.GetValue("Platform", typeof(string)); 53 | 54 | PlatformType platform; 55 | return Enum.TryParse(FirstCharToUpper(platformValue), out platform) ? platform : PlatformType.Windows; 56 | } 57 | 58 | /// 59 | /// In order to match the enum will have to Title case the OS string value. 60 | /// This is more protection for when someone enters the OS all lowercase 61 | /// 62 | /// 63 | /// 64 | public static string FirstCharToUpper(string input) 65 | { 66 | if (String.IsNullOrEmpty(input)) 67 | throw new ArgumentException("The string was null or empty."); 68 | return input.First().ToString().ToUpper() + String.Join("", input.Skip(1)).ToLower(); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/SetUp/TestDriverFactory.cs: -------------------------------------------------------------------------------- 1 | using OpenQA.Selenium; 2 | using WebDriverDriverFactory.Common; 3 | using WebDriverDriverFactory.Config; 4 | 5 | namespace RichardsTestSuite.SetUp 6 | { 7 | /// 8 | /// Calls the WebDriver factory by creating required configuration based on the remote value. 9 | /// 10 | public class TestDriverFactory 11 | { 12 | public IWebDriver CreateDriver() 13 | { 14 | //If remote is true, then create a RemoteDriverConfig and pass it to the factory 15 | if (TestConfiguration.Remote) 16 | { 17 | return new WebDriverFactory().Create( 18 | new RemoteDriverConfiguration( 19 | TestConfiguration.Browser, 20 | TestConfiguration.Platform, 21 | TestConfiguration.BrowserVersion, 22 | TestConfiguration.SeleniumHubUrl, 23 | TestConfiguration.SeleniumHubPort)); 24 | } 25 | 26 | //Else (false) create a LocalDriverConfig and pass this to the factory 27 | return new WebDriverFactory().Create( 28 | new LocalDriverConfiguration( 29 | TestConfiguration.Browser)); 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/Tests/LoginTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using NUnit.Framework; 7 | using OpenQA.Selenium; 8 | using RichardsTestSuite.SetUp; 9 | using RichardsTestSuite.PageObjects; 10 | 11 | namespace RichardsTestSuite.Tests 12 | { 13 | [TestFixture] 14 | public class LoginTests 15 | { 16 | private IWebDriver _driver; 17 | 18 | [SetUp] 19 | public void SetUp() 20 | { 21 | //We already have a Driver Instance because the SetUpFixture will have created it. 22 | //However I like to assign to a local property. 23 | _driver = DriverSetup.Driver; 24 | _driver.Navigate().GoToUrl(TestConfiguration.ApplicationUrl); 25 | } 26 | 27 | [Test] 28 | public void BadEmailAddressTest() 29 | { 30 | var loginPage = new LoginPage(_driver); 31 | loginPage.PopulateUsername("richardbradshaw123@hotmail.com"); 32 | loginPage.PopulatePassword("password"); 33 | loginPage = loginPage.ClickLoginExpectingError(); 34 | 35 | Assert.That(loginPage.ReadLoginErrorMessage(), Is.EqualTo("That Microsoft account doesn't exist. Enter a different email address or get a new account.")); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/RichardsTestSuite/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriverDriverFactory", "WebDriverDriverFactory\WebDriverDriverFactory.csproj", "{86BAF6FB-8439-4753-B220-C1C1CB1F571D}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RichardsTestSuite", "RichardsTestSuite\RichardsTestSuite.csproj", "{25146C22-AAEB-442B-A6B9-FDD69DF56BD8}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {86BAF6FB-8439-4753-B220-C1C1CB1F571D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {86BAF6FB-8439-4753-B220-C1C1CB1F571D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {86BAF6FB-8439-4753-B220-C1C1CB1F571D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {86BAF6FB-8439-4753-B220-C1C1CB1F571D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {25146C22-AAEB-442B-A6B9-FDD69DF56BD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {25146C22-AAEB-442B-A6B9-FDD69DF56BD8}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {25146C22-AAEB-442B-A6B9-FDD69DF56BD8}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {25146C22-AAEB-442B-A6B9-FDD69DF56BD8}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/Configurations/LocalDriverConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebDriverDriverFactory.Config 4 | { 5 | /// 6 | /// A LocalDriverConfiguration class. 7 | /// For a local instance we only require the browser's name 8 | /// 9 | public class LocalDriverConfiguration 10 | { 11 | public string Browser { get; set; } 12 | 13 | public LocalDriverConfiguration(string browser) 14 | { 15 | Browser = browser; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/Configurations/RemoteDriverConfiguration.cs: -------------------------------------------------------------------------------- 1 | using OpenQA.Selenium; 2 | 3 | namespace WebDriverDriverFactory.Config 4 | { 5 | /// 6 | /// A RemoteDriverConfiguration class 7 | /// Used to construct driver requirements to send to the GRID Hub 8 | /// 9 | public class RemoteDriverConfiguration 10 | { 11 | public string Browser { get; set; } 12 | 13 | public PlatformType Platform { get; set; } 14 | 15 | public string BrowserVersion { get; set; } 16 | 17 | public string SeleniumHubUrl { get; set; } 18 | 19 | public int SeleniumHubPort { get; set; } 20 | 21 | public RemoteDriverConfiguration(string browser, PlatformType platform, string browserVersion, string seleniumHubUrl, int seleniumHubPort) 22 | { 23 | Browser = browser; 24 | Platform = platform; 25 | BrowserVersion = browserVersion; 26 | SeleniumHubUrl = seleniumHubUrl; 27 | SeleniumHubPort = seleniumHubPort; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/DriverServices/IEDriverServer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/WebDriverDriverFactory/DriverServices/IEDriverServer.exe -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/DriverServices/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/WebDriverDriverFactory/DriverServices/chromedriver.exe -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/DriverServices/phantomjs.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/WebDriverDriverFactory/DriverServices/phantomjs.exe -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WebDriverDriverFactory")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WebDriverDriverFactory")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("672b8922-1caf-4e53-b651-4f77ab282bad")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/WebDriverDriverFactory.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {86BAF6FB-8439-4753-B220-C1C1CB1F571D} 8 | Library 9 | Properties 10 | WebDriverDriverFactory 11 | WebDriverDriverFactory 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ..\packages\Selenium.WebDriver.2.39.0\lib\net40\WebDriver.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Always 57 | 58 | 59 | Always 60 | 61 | 62 | Always 63 | 64 | 65 | 66 | 73 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/WebDriverFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using OpenQA.Selenium; 3 | using OpenQA.Selenium.Chrome; 4 | using OpenQA.Selenium.Firefox; 5 | using OpenQA.Selenium.IE; 6 | using OpenQA.Selenium.PhantomJS; 7 | using OpenQA.Selenium.Remote; 8 | using WebDriverDriverFactory.Config; 9 | 10 | namespace WebDriverDriverFactory.Common 11 | { 12 | public class WebDriverFactory 13 | { 14 | //DesiredCapabilites is used to add specific browser requirements to RemoteWebDriver, such as version, OS. 15 | private DesiredCapabilities _capabilities; 16 | //Declare an instance of an IWebDriver to assign a browser driver to. 17 | //We use IWebDriver as all browsers use this interface, so all compatible. 18 | private IWebDriver _driver; 19 | 20 | /// 21 | /// This method will create a local driver, as it takes the LocalDriver configuation object 22 | /// 23 | /// An instance of the LocalDriverConfiguration object. 24 | /// Driver that mets the configuration 25 | public IWebDriver Create(LocalDriverConfiguration configuration) 26 | { 27 | //A simple switch statement to determine which driver/service to create. 28 | switch (configuration.Browser) 29 | { 30 | case "chrome": 31 | _driver = new ChromeDriver(@"DriverServices"); 32 | break; 33 | 34 | case "internet explorer": 35 | var options = new InternetExplorerOptions { EnableNativeEvents = false }; 36 | _driver = new InternetExplorerDriver(@"DriverServices", options); 37 | break; 38 | 39 | case "firefox": 40 | _driver = new FirefoxDriver(); 41 | break; 42 | 43 | case "phantomjs": 44 | _driver = new PhantomJSDriver(@"DriverServices"); 45 | break; 46 | 47 | //If a string isn't matched, it will default to FireFoxDriver 48 | default: 49 | _driver = new FirefoxDriver(); 50 | break; 51 | } 52 | 53 | //Return the driver instance to the calling class. 54 | return _driver; 55 | } 56 | 57 | /// 58 | /// This method will create a remotedriver, as it takes the RemoteDriver configuation object 59 | /// 60 | /// 61 | /// 62 | public IWebDriver Create(RemoteDriverConfiguration configuration) 63 | { 64 | //Will need to construct the remoteServerUri so it can be passed to the remoteWebDriver. 65 | var remoteServer = BuildRemoteServer(configuration.SeleniumHubUrl, configuration.SeleniumHubPort); 66 | 67 | switch (configuration.Browser) 68 | { 69 | //Switch on browser name 70 | //Create a DesiredCapabilities for the required driver. 71 | case "firefox": 72 | _capabilities = DesiredCapabilities.Firefox(); 73 | break; 74 | 75 | case "chrome": 76 | _capabilities = DesiredCapabilities.Chrome(); 77 | break; 78 | 79 | case "internet explorer": 80 | _capabilities = DesiredCapabilities.InternetExplorer(); 81 | break; 82 | } 83 | 84 | //This method adds additional information to the desired capabilities, in this instance browser version and operating system. 85 | SetCapabilities(configuration.Platform, configuration.BrowserVersion); 86 | 87 | //We then create a new RemoteWebDriver with the Uri created earlier and the desired capabilities object. 88 | //This would then call your GRID instance and find a match and start the browser on the matching node. 89 | _driver = new RemoteWebDriver(new Uri(remoteServer), _capabilities); 90 | 91 | //Return the driver to the calling class. 92 | return _driver; 93 | } 94 | 95 | /// 96 | /// Adds additional required capabilities to the desiredCapabilities object. 97 | /// 98 | /// OS enum, conversation is done at Configuration level. 99 | /// Version number of browser, note that this is a string. 100 | private void SetCapabilities(PlatformType platform, string browserVersion) 101 | { 102 | _capabilities.SetCapability(CapabilityType.Platform, new Platform(platform)); 103 | _capabilities.SetCapability(CapabilityType.Version, browserVersion); 104 | } 105 | 106 | /// 107 | /// Build a Uri for your GRID Hub instance 108 | /// 109 | /// The hostname or IP address of your GRID instance, include the http:// 110 | /// Port of your GRID Hub instance 111 | /// The correct Uri as a string 112 | private static string BuildRemoteServer(string remoteServer, int remoteServerPort) 113 | { 114 | return string.Format("{0}:{1}/wd/hub", remoteServer, remoteServerPort); 115 | } 116 | } 117 | } -------------------------------------------------------------------------------- /WebDriverDriverFactory/WebDriverDriverFactory/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/NUnit.2.6.3/NUnit.2.6.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/NUnit.2.6.3/NUnit.2.6.3.nupkg -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/NUnit.2.6.3/NUnit.2.6.3.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NUnit 5 | 2.6.3 6 | NUnit 7 | Charlie Poole 8 | Charlie Poole 9 | http://nunit.org/nuget/license.html 10 | http://nunit.org/ 11 | http://nunit.org/nuget/nunit_32x32.png 12 | false 13 | NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. A number of runners, both from the NUnit project and by third parties, are able to execute NUnit tests. 14 | 15 | Version 2.6 is the seventh major release of this well-known and well-tested programming tool. 16 | 17 | This package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. 18 | NUnit is a unit-testing framework for all .Net languages with a strong TDD focus. 19 | Version 2.6 is the seventh major release of NUnit. 20 | 21 | Unlike earlier versions, this package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. 22 | 23 | The nunit.mocks assembly is now provided by the NUnit.Mocks package. The pnunit.framework assembly is provided by the pNUnit package. 24 | 25 | en-US 26 | nunit test testing tdd framework fluent assert theory plugin addin 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/NUnit.2.6.3/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/NUnit.2.6.3/lib/nunit.framework.dll -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/NUnit.2.6.3/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/NUnit.2.6.3/license.txt -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.Support.2.39.0/Selenium.Support.2.39.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/Selenium.Support.2.39.0/Selenium.Support.2.39.0.nupkg -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.Support.2.39.0/Selenium.Support.2.39.0.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Selenium.Support 5 | 2.39.0 6 | Selenium WebDriver Support Classes 7 | Selenium Committers 8 | Selenium Committers 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | http://code.google.com/p/selenium/ 11 | http://seleniumhq.org/images/big-logo.png 12 | false 13 | Selenium is a set of different software tools each with a different approach to supporting browser automation. These tools are highly flexible, allowing many options for locating and manipulating elements within a browser, and one of its key features is the support for automating multiple browser platforms. This package contains .NET support classes for the Selenium WebDriver API, which includes helper classes for HTML Select elements, waiting for conditions, and Page Object creation. 14 | Support classes for the .NET bindings of the Selenium WebDriver API 15 | 16 | 17 | 18 | Selenium WebDriver browser automation support 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.Support.2.39.0/lib/net35/WebDriver.Support.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/Selenium.Support.2.39.0/lib/net35/WebDriver.Support.dll -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.Support.2.39.0/lib/net35/WebDriver.Support.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WebDriver.Support 5 | 6 | 7 | 8 | 9 | A wrapper around an arbitrary WebDriver instance which supports registering for 10 | events, e.g. for logging purposes. 11 | 12 | 13 | 14 | 15 | Initializes a new instance of the EventFiringWebDriver class. 16 | 17 | The driver to register events for. 18 | 19 | 20 | 21 | Close the current window, quitting the browser if it is the last window currently open. 22 | 23 | 24 | 25 | 26 | Quits this driver, closing every associated window. 27 | 28 | 29 | 30 | 31 | Instructs the driver to change its settings. 32 | 33 | An object allowing the user to change 34 | the settings of the driver. 35 | 36 | 37 | 38 | Instructs the driver to navigate the browser to another location. 39 | 40 | An object allowing the user to access 41 | the browser's history and to navigate to a given URL. 42 | 43 | 44 | 45 | Instructs the driver to send future commands to a different frame or window. 46 | 47 | An object which can be used to select 48 | a frame or window. 49 | 50 | 51 | 52 | Find the first using the given method. 53 | 54 | The locating mechanism to use. 55 | The first matching on the current context. 56 | If no element matches the criteria. 57 | 58 | 59 | 60 | Find all IWebElements within the current context 61 | using the given mechanism. 62 | 63 | The locating mechanism to use. 64 | A of all WebElements 65 | matching the current criteria, or an empty list if nothing matches. 66 | 67 | 68 | 69 | Frees all managed and unmanaged resources used by this instance. 70 | 71 | 72 | 73 | 74 | Executes JavaScript in the context of the currently selected frame or window. 75 | 76 | The JavaScript code to execute. 77 | The arguments to the script. 78 | The value returned by the script. 79 | 80 | 81 | The method executes JavaScript in the context of 82 | the currently selected frame or window. This means that "document" will refer 83 | to the current document. If the script has a return value, then the following 84 | steps will be taken: 85 | 86 | 87 | 88 | For an HTML element, this method returns a 89 | For a number, a is returned 90 | For a boolean, a is returned 91 | For all other cases a is returned. 92 | For an array,we check the first element, and attempt to return a 93 | of that type, following the rules above. Nested lists are not 94 | supported. 95 | If the value is null or there is no return value, 96 | is returned. 97 | 98 | 99 | 100 | Arguments must be a number (which will be converted to a ), 101 | a , a or a . 102 | An exception will be thrown if the arguments do not meet these criteria. 103 | The arguments will be made available to the JavaScript via the "arguments" magic 104 | variable, as if the function were called via "Function.apply" 105 | 106 | 107 | 108 | 109 | 110 | Executes JavaScript asynchronously in the context of the currently selected frame or window. 111 | 112 | The JavaScript code to execute. 113 | The arguments to the script. 114 | The value returned by the script. 115 | 116 | 117 | 118 | Gets a object representing the image of the page on the screen. 119 | 120 | A object containing the image. 121 | 122 | 123 | 124 | Frees all managed and, optionally, unmanaged resources used by this instance. 125 | 126 | to dispose of only managed resources; 127 | to dispose of managed and unmanaged resources. 128 | 129 | 130 | 131 | Raises the event. 132 | 133 | A that contains the event data. 134 | 135 | 136 | 137 | Raises the event. 138 | 139 | A that contains the event data. 140 | 141 | 142 | 143 | Raises the event. 144 | 145 | A that contains the event data. 146 | 147 | 148 | 149 | Raises the event. 150 | 151 | A that contains the event data. 152 | 153 | 154 | 155 | Raises the event. 156 | 157 | A that contains the event data. 158 | 159 | 160 | 161 | Raises the event. 162 | 163 | A that contains the event data. 164 | 165 | 166 | 167 | Raises the event. 168 | 169 | A that contains the event data. 170 | 171 | 172 | 173 | Raises the event. 174 | 175 | A that contains the event data. 176 | 177 | 178 | 179 | Raises the event. 180 | 181 | A that contains the event data. 182 | 183 | 184 | 185 | Raises the event. 186 | 187 | A that contains the event data. 188 | 189 | 190 | 191 | Raises the event. 192 | 193 | A that contains the event data. 194 | 195 | 196 | 197 | Raises the event. 198 | 199 | A that contains the event data. 200 | 201 | 202 | 203 | Raises the event. 204 | 205 | A that contains the event data. 206 | 207 | 208 | 209 | Raises the event. 210 | 211 | A that contains the event data. 212 | 213 | 214 | 215 | Raises the event. 216 | 217 | A that contains the event data. 218 | 219 | 220 | 221 | Fires before the driver begins navigation. 222 | 223 | 224 | 225 | 226 | Fires after the driver completes navigation 227 | 228 | 229 | 230 | 231 | Fires before the driver begins navigation back one entry in the browser history list. 232 | 233 | 234 | 235 | 236 | Fires after the driver completes navigation back one entry in the browser history list. 237 | 238 | 239 | 240 | 241 | Fires before the driver begins navigation forward one entry in the browser history list. 242 | 243 | 244 | 245 | 246 | Fires after the driver completes navigation forward one entry in the browser history list. 247 | 248 | 249 | 250 | 251 | Fires before the driver clicks on an element. 252 | 253 | 254 | 255 | 256 | Fires after the driver has clicked on an element. 257 | 258 | 259 | 260 | 261 | Fires before the driver changes the value of an element via Clear(), SendKeys() or Toggle(). 262 | 263 | 264 | 265 | 266 | Fires after the driver has changed the value of an element via Clear(), SendKeys() or Toggle(). 267 | 268 | 269 | 270 | 271 | Fires before the driver starts to find an element. 272 | 273 | 274 | 275 | 276 | Fires after the driver completes finding an element. 277 | 278 | 279 | 280 | 281 | Fires before a script is executed. 282 | 283 | 284 | 285 | 286 | Fires after a script is executed. 287 | 288 | 289 | 290 | 291 | Fires when an exception is thrown. 292 | 293 | 294 | 295 | 296 | Gets the wrapped by this EventsFiringWebDriver instance. 297 | 298 | 299 | 300 | 301 | Gets or sets the URL the browser is currently displaying. 302 | 303 | 304 | Setting the property will load a new web page in the current browser window. 305 | This is done using an HTTP GET operation, and the method will block until the 306 | load is complete. This will follow redirects issued either by the server or 307 | as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" 308 | for any duration of time, it is best to wait until this timeout is over, since 309 | should the underlying page change while your test is executing the results of 310 | future calls against this interface will be against the freshly loaded page. 311 | 312 | 313 | 314 | 315 | 316 | 317 | Gets the title of the current browser window. 318 | 319 | 320 | 321 | 322 | Gets the source of the page last loaded by the browser. 323 | 324 | 325 | If the page has been modified after loading (for example, by JavaScript) 326 | there is no guarantee that the returned text is that of the modified page. 327 | Please consult the documentation of the particular driver being used to 328 | determine whether the returned text reflects the current state of the page 329 | or the text last sent by the web server. The page source returned is a 330 | representation of the underlying DOM: do not expect it to be formatted 331 | or escaped in the same way as the response sent from the web server. 332 | 333 | 334 | 335 | 336 | Gets the current window handle, which is an opaque handle to this 337 | window that uniquely identifies it within this driver instance. 338 | 339 | 340 | 341 | 342 | Gets the window handles of open browser windows. 343 | 344 | 345 | 346 | 347 | Provides a mechanism for Navigating with the driver. 348 | 349 | 350 | 351 | 352 | Initializes a new instance of the EventFiringNavigation class 353 | 354 | Driver in use 355 | 356 | 357 | 358 | Move the browser back 359 | 360 | 361 | 362 | 363 | Move the browser forward 364 | 365 | 366 | 367 | 368 | Navigate to a url for your test 369 | 370 | String of where you want the browser to go to 371 | 372 | 373 | 374 | Navigate to a url for your test 375 | 376 | Uri object of where you want the browser to go to 377 | 378 | 379 | 380 | Refresh the browser 381 | 382 | 383 | 384 | 385 | Provides a mechanism for setting options needed for the driver during the test. 386 | 387 | 388 | 389 | 390 | Initializes a new instance of the EventFiringOptions class 391 | 392 | Instance of the driver currently in use 393 | 394 | 395 | 396 | Provides access to the timeouts defined for this driver. 397 | 398 | An object implementing the interface. 399 | 400 | 401 | 402 | Gets an object allowing the user to manipulate cookies on the page. 403 | 404 | 405 | 406 | 407 | Gets an object allowing the user to manipulate the currently-focused browser window. 408 | 409 | "Currently-focused" is defined as the browser window having the window handle 410 | returned when IWebDriver.CurrentWindowHandle is called. 411 | 412 | 413 | 414 | Provides a mechanism for finding elements on the page with locators. 415 | 416 | 417 | 418 | 419 | Initializes a new instance of the EventFiringTargetLocator class 420 | 421 | The driver that is currently in use 422 | 423 | 424 | 425 | Move to a different frame using its index 426 | 427 | The index of the 428 | A WebDriver instance that is currently in use 429 | 430 | 431 | 432 | Move to different frame using its name 433 | 434 | name of the frame 435 | A WebDriver instance that is currently in use 436 | 437 | 438 | 439 | Move to a frame element. 440 | 441 | a previously found FRAME or IFRAME element. 442 | A WebDriver instance that is currently in use. 443 | 444 | 445 | 446 | Change to the Window by passing in the name 447 | 448 | name of the window that you wish to move to 449 | A WebDriver instance that is currently in use 450 | 451 | 452 | 453 | Change the active frame to the default 454 | 455 | Element of the default 456 | 457 | 458 | 459 | Finds the active element on the page and returns it 460 | 461 | Element that is active 462 | 463 | 464 | 465 | Switches to the currently active modal dialog for this particular driver instance. 466 | 467 | A handle to the dialog. 468 | 469 | 470 | 471 | Defines the interface through which the user can define timeouts. 472 | 473 | 474 | 475 | 476 | Initializes a new instance of the EventFiringTimeouts class 477 | 478 | The object to wrap. 479 | 480 | 481 | 482 | Specifies the amount of time the driver should wait when searching for an 483 | element if it is not immediately present. 484 | 485 | A structure defining the amount of time to wait. 486 | A self reference 487 | 488 | When searching for a single element, the driver should poll the page 489 | until the element has been found, or this timeout expires before throwing 490 | a . When searching for multiple elements, 491 | the driver should poll the page until at least one element has been found 492 | or this timeout has expired. 493 | 494 | Increasing the implicit wait timeout should be used judiciously as it 495 | will have an adverse effect on test run time, especially when used with 496 | slower location strategies like XPath. 497 | 498 | 499 | 500 | 501 | 502 | Specifies the amount of time the driver should wait when executing JavaScript asynchronously. 503 | 504 | A structure defining the amount of time to wait. 505 | A self reference 506 | 507 | 508 | 509 | Specifies the amount of time the driver should wait for a page to load when setting the property. 510 | 511 | A structure defining the amount of time to wait. 512 | A self reference 513 | 514 | 515 | 516 | EventFiringWebElement allows you to have access to specific items that are found on the page 517 | 518 | 519 | 520 | 521 | Initializes a new instance of the class. 522 | 523 | The instance hosting this element. 524 | The to wrap for event firing. 525 | 526 | 527 | 528 | Method to clear the text out of an Input element 529 | 530 | 531 | 532 | 533 | Method for sending native key strokes to the browser 534 | 535 | String containing what you would like to type onto the screen 536 | 537 | 538 | 539 | If this current element is a form, or an element within a form, then this will be submitted to the remote server. 540 | If this causes the current page to change, then this method will block until the new page is loaded. 541 | 542 | 543 | 544 | 545 | Click this element. If this causes a new page to load, this method will block until 546 | the page has loaded. At this point, you should discard all references to this element 547 | and any further operations performed on this element will have undefined behavior unless 548 | you know that the element and the page will still be present. If this element is not 549 | clickable, then this operation is a no-op since it's pretty common for someone to 550 | accidentally miss the target when clicking in Real Life 551 | 552 | 553 | 554 | 555 | If this current element is a form, or an element within a form, then this will be submitted to the remote server. If this causes the current page to change, then this method will block until the new page is loaded. 556 | 557 | Attribute you wish to get details of 558 | The attribute's current value or null if the value is not set. 559 | 560 | 561 | 562 | Method to return the value of a CSS Property 563 | 564 | CSS property key 565 | string value of the CSS property 566 | 567 | 568 | 569 | Finds the first element in the page that matches the object 570 | 571 | By mechanism to find the element 572 | IWebElement object so that you can interaction that object 573 | 574 | 575 | 576 | Finds the elements on the page by using the object and returns a ReadOnlyCollection of the Elements on the page 577 | 578 | By mechanism to find the element 579 | ReadOnlyCollection of IWebElement 580 | 581 | 582 | 583 | Gets the underlying wrapped . 584 | 585 | 586 | 587 | 588 | Gets the DOM Tag of element 589 | 590 | 591 | 592 | 593 | Gets the text from the element 594 | 595 | 596 | 597 | 598 | Gets a value indicating whether an element is currently enabled 599 | 600 | 601 | 602 | 603 | Gets a value indicating whether this element is selected or not. This operation only applies to input elements such as checkboxes, options in a select and radio buttons. 604 | 605 | 606 | 607 | 608 | Gets the Location of an element and returns a Point object 609 | 610 | 611 | 612 | 613 | Gets the of the element on the page 614 | 615 | 616 | 617 | 618 | Gets a value indicating whether the element is currently being displayed 619 | 620 | 621 | 622 | 623 | Gets the underlying EventFiringWebDriver for this element. 624 | 625 | 626 | 627 | 628 | Provides data for events related to finding elements. 629 | 630 | 631 | 632 | 633 | Initializes a new instance of the class. 634 | 635 | The WebDriver instance used in finding elements. 636 | The object containing the method used to find elements 637 | 638 | 639 | 640 | Initializes a new instance of the class. 641 | 642 | The WebDriver instance used in finding elements. 643 | The parent element used as the context for the search. 644 | The object containing the method used to find elements. 645 | 646 | 647 | 648 | Gets the WebDriver instance used in finding elements. 649 | 650 | 651 | 652 | 653 | Gets the parent element used as the context for the search. 654 | 655 | 656 | 657 | 658 | Gets the object containing the method used to find elements. 659 | 660 | 661 | 662 | 663 | Provides data for events relating to exception handling. 664 | 665 | 666 | 667 | 668 | Initializes a new instance of the class. 669 | 670 | The WebDriver instance throwing the exception. 671 | The exception thrown by the driver. 672 | 673 | 674 | 675 | Gets the exception thrown by the driver. 676 | 677 | 678 | 679 | 680 | Gets the WebDriver instance . 681 | 682 | 683 | 684 | 685 | Provides data for events relating to navigation. 686 | 687 | 688 | 689 | 690 | Initializes a new instance of the class. 691 | 692 | The WebDriver instance used in navigation. 693 | 694 | 695 | 696 | Initializes a new instance of the class. 697 | 698 | The WebDriver instance used in navigation. 699 | The URL navigated to by the driver. 700 | 701 | 702 | 703 | Gets the URL navigated to by the driver. 704 | 705 | 706 | 707 | 708 | Gets the WebDriver instance used in navigation. 709 | 710 | 711 | 712 | 713 | Provides data for events relating to executing JavaScript. 714 | 715 | 716 | 717 | 718 | Initializes a new instance of the class. 719 | 720 | The WebDriver instance used to execute the script. 721 | The script executed by the driver. 722 | 723 | 724 | 725 | Gets the WebDriver instance used to execute the script. 726 | 727 | 728 | 729 | 730 | Gets the script executed by the driver. 731 | 732 | 733 | 734 | 735 | Provides data for events relating to elements. 736 | 737 | 738 | 739 | 740 | Initializes a new instance of the class. 741 | 742 | The WebDriver instance used for the action. 743 | The element used for the action. 744 | 745 | 746 | 747 | Gets the WebDriver instance used for the action. 748 | 749 | 750 | 751 | 752 | Gets the element used for the action. 753 | 754 | 755 | 756 | 757 | Provides extension methods for convenience in using WebDriver. 758 | 759 | 760 | 761 | 762 | Gets a object representing the image of the page on the screen. 763 | 764 | The driver instance to extend. 765 | A object containing the image. 766 | Thrown if this instance 767 | does not implement , or the capabilities of the driver 768 | indicate that it cannot take screenshots. 769 | 770 | 771 | 772 | Executes JavaScript in the context of the currently selected frame or window 773 | 774 | Expected return type of the JavaScript execution. 775 | The driver instance to extend. 776 | The JavaScript code to execute. 777 | The arguments to the script. 778 | The value returned by the script. 779 | Thrown if this instance 780 | does not implement , or if the actual return type 781 | of the JavaScript execution does not match the expected type. 782 | 783 | 784 | 785 | Mechanism used to locate elements within a document using a series of other lookups. This class 786 | will find all DOM elements that matches each of the locators in sequence 787 | 788 | 789 | The following code will will find all elements that match by2 and appear under an element that matches 790 | by1. 791 | 792 | driver.findElements(new ByChained(by1, by2)) 793 | 794 | 795 | 796 | 797 | 798 | Initializes a new instance of the class with one or more objects. 799 | 800 | One or more references 801 | 802 | 803 | 804 | Find a single element. 805 | 806 | Context used to find the element. 807 | The element that matches 808 | 809 | 810 | 811 | Finds many elements 812 | 813 | Context used to find the element. 814 | A readonly collection of elements that match. 815 | 816 | 817 | 818 | Writes out a comma separated list of the objects used in the chain. 819 | 820 | Converts the value of this instance to a 821 | 822 | 823 | 824 | Provides instances of the object to the attributes. 825 | 826 | 827 | 828 | 829 | Gets an instance of the class based on the specified attribute. 830 | 831 | The describing how to find the element. 832 | An instance of the class. 833 | 834 | 835 | 836 | Marks the element so that lookups to the browser page are cached. This class cannot be inherited. 837 | 838 | 839 | 840 | 841 | Marks program elements with methods by which to find a corresponding element on the page. Used 842 | in conjunction with the , it allows you to quickly create Page Objects. 843 | 844 | 845 | 846 | You can use this attribute by specifying the and properties 847 | to indicate how to find the elements. This attribute can be used to decorate fields and properties 848 | in your Page Object classes. The of the field or property must be either 849 | or IList{IWebElement}. Any other type will throw an 850 | when is called. 851 | 852 | 853 | 854 | [FindsBy(How = How.Name, Using = "myElementName")] 855 | public IWebElement foundElement; 856 | 857 | [FindsBy(How = How.TagName, Using = "a")] 858 | public IList{IWebElement} allLinks; 859 | 860 | 861 | 862 | You can also use multiple instances of this attribute to find an element that may meet 863 | one of multiple criteria. When using multiple instances, you can specify the order in 864 | which the criteria is matched by using the property. 865 | 866 | 867 | 868 | // Will find the element with the name attribute matching the first of "anElementName" 869 | // or "differentElementName". 870 | [FindsBy(How = How.Name, Using = "anElementName", Priority = 0)] 871 | [FindsBy(How = How.Name, Using = "differentElementName", Priority = 1)] 872 | public IWebElement thisElement; 873 | 874 | 875 | 876 | 877 | 878 | 879 | Determines if two instances are equal. 880 | 881 | One instance to compare. 882 | The other instance to compare. 883 | if the two instances are equal; otherwise, . 884 | 885 | 886 | 887 | Determines if two instances are unequal. 888 | s 889 | One instance to compare. 890 | The other instance to compare. 891 | if the two instances are not equal; otherwise, . 892 | 893 | 894 | 895 | Determines if one instance is greater than another. 896 | 897 | One instance to compare. 898 | The other instance to compare. 899 | if the first instance is greater than the second; otherwise, . 900 | 901 | 902 | 903 | Determines if one instance is less than another. 904 | 905 | One instance to compare. 906 | The other instance to compare. 907 | if the first instance is less than the second; otherwise, . 908 | 909 | 910 | 911 | Compares the current instance with another object of the same type and returns an 912 | integer that indicates whether the current instance precedes, follows, or occurs 913 | in the same position in the sort order as the other object. 914 | 915 | An object to compare with this instance. 916 | A value that indicates the relative order of the objects being compared. The return value has these meanings: 917 | 918 | ValueMeaning 919 | Less than zeroThis instance precedes in the sort order. 920 | ZeroThis instance occurs in the same position in the sort order as . 921 | Greater than zeroThis instance follows in the sort order. 922 | 923 | 924 | 925 | 926 | 927 | Determines whether the specified Object is equal 928 | to the current Object. 929 | 930 | The Object to compare with the 931 | current Object. 932 | if the specified Object 933 | is equal to the current Object; otherwise, 934 | . 935 | 936 | 937 | 938 | Serves as a hash function for a particular type. 939 | 940 | A hash code for the current Object. 941 | 942 | 943 | 944 | Gets or sets the method used to look up the element 945 | 946 | 947 | 948 | 949 | Gets or sets the value to lookup by (i.e. for How.Name, the actual name to look up) 950 | 951 | 952 | 953 | 954 | Gets or sets a value indicating where this attribute should be evaluated relative to other instances 955 | of this attribute decorating the same class member. 956 | 957 | 958 | 959 | 960 | Gets or sets a value indicating the of the custom finder. The custom finder must 961 | descend from the class, and expose a public constructor that takes a 962 | argument. 963 | 964 | 965 | 966 | 967 | Gets or sets an explicit object to find by. 968 | Setting this property takes precedence over setting the How or Using properties. 969 | 970 | 971 | 972 | 973 | Provides the lookup methods for the FindsBy attribute (for using in PageObjects) 974 | 975 | 976 | 977 | 978 | Finds by 979 | 980 | 981 | 982 | 983 | Finds by 984 | 985 | 986 | 987 | 988 | Finds by 989 | 990 | 991 | 992 | 993 | Finds by 994 | 995 | 996 | 997 | 998 | Finds by 999 | 1000 | 1001 | 1002 | 1003 | Finds by 1004 | 1005 | 1006 | 1007 | 1008 | Finds by 1009 | 1010 | 1011 | 1012 | 1013 | Finds by 1014 | 1015 | 1016 | 1017 | 1018 | Finds by a custom implementation. 1019 | 1020 | 1021 | 1022 | 1023 | Provides the ability to produce Page Objects modeling a page. This class cannot be inherited. 1024 | 1025 | 1026 | 1027 | 1028 | Prevents a default instance of the PageFactory class from being created. 1029 | 1030 | 1031 | 1032 | 1033 | Initializes the elements in the Page Object with the given type. 1034 | 1035 | The of the Page Object class. 1036 | The instance used to populate the page. 1037 | An instance of the Page Object class with the elements initialized. 1038 | 1039 | The class used in the argument must have a public constructor 1040 | that takes a single argument of type . This helps to enforce 1041 | best practices of the Page Object pattern, and encapsulates the driver into the Page 1042 | Object so that it can have no external WebDriver dependencies. 1043 | 1044 | 1045 | thrown if no constructor to the class can be found with a single IWebDriver argument 1046 | -or- 1047 | if a field or property decorated with the is not of type 1048 | or IList{IWebElement}. 1049 | 1050 | 1051 | 1052 | 1053 | Initializes the elements in the Page Object. 1054 | 1055 | The driver used to find elements on the page. 1056 | The Page Object to be populated with elements. 1057 | 1058 | thrown if a field or property decorated with the is not of type 1059 | or IList{IWebElement}. 1060 | 1061 | 1062 | 1063 | 1064 | Represents a proxy class for a list of elements to be used with the PageFactory. 1065 | 1066 | 1067 | 1068 | 1069 | Initializes a new instance of the class. 1070 | 1071 | The driver used to search for elements. 1072 | The list of methods by which to search for the elements. 1073 | to cache the lookup to the element; otherwise, . 1074 | 1075 | 1076 | 1077 | Prevents a default instance of the class from being created. 1078 | 1079 | 1080 | 1081 | 1082 | Determines whether an element is in the . 1083 | 1084 | The object to locate in the . The value can be . 1085 | if the specified item is in the list; otherwise, . 1086 | 1087 | 1088 | 1089 | Copies the elements of the to an Array, starting at a particular Array index. 1090 | 1091 | The one-dimensional Array that is the destination of the elements copied from . 1092 | The Array must have zero-based indexing. 1093 | The zero-based index in array at which copying begins. 1094 | 1095 | 1096 | 1097 | Determines the index of a specific item in the . 1098 | 1099 | The object to locate in the . 1100 | The index of if found in the list; otherwise, -1. 1101 | 1102 | 1103 | 1104 | Adds an item to the . 1105 | 1106 | The to add. 1107 | 1108 | 1109 | 1110 | Removes all items from the . 1111 | 1112 | 1113 | 1114 | 1115 | Inserts an item to the at the specified index. 1116 | 1117 | The zero-based index at which item should be inserted. 1118 | The object to insert into the . 1119 | 1120 | 1121 | 1122 | Removes the item at the specified index. 1123 | 1124 | The zero-based index of the item to remove. 1125 | 1126 | 1127 | 1128 | Removes the first occurrence of a specific object from the . 1129 | 1130 | The object to remove from the . 1131 | if item was successfully removed from the ; 1132 | otherwise, . This method also returns if item is not found 1133 | in the original . 1134 | 1135 | 1136 | 1137 | Returns an enumerator that iterates through the collection. 1138 | 1139 | A that can be used to iterate through the collection. 1140 | 1141 | 1142 | 1143 | Returns an enumerator that iterates through the collection. 1144 | 1145 | A IEnumerator{IWebElement} that can be used to iterate through the collection. 1146 | 1147 | 1148 | 1149 | Gets the number of elements contained in the instance. 1150 | 1151 | 1152 | 1153 | 1154 | Gets a value indicating whether this list is read only. 1155 | 1156 | 1157 | 1158 | 1159 | Gets or sets the element at the specified index. 1160 | 1161 | The zero-based index of the element to get or set. 1162 | The at the specified index. 1163 | 1164 | 1165 | 1166 | Represents a proxy class for an element to be used with the PageFactory. 1167 | 1168 | 1169 | 1170 | 1171 | Initializes a new instance of the class. 1172 | 1173 | The driver used to search for elements. 1174 | The list of methods by which to search for the element. 1175 | to cache the lookup to the element; otherwise, . 1176 | 1177 | 1178 | 1179 | Prevents a default instance of the class from being created. 1180 | 1181 | 1182 | 1183 | 1184 | Clears the content of this element. 1185 | 1186 | 1187 | 1188 | 1189 | Simulates typing text into the element. 1190 | 1191 | The keys to send to the element. 1192 | 1193 | 1194 | 1195 | Submits this element to the web server. 1196 | 1197 | 1198 | 1199 | 1200 | Clicks this element. 1201 | 1202 | 1203 | 1204 | 1205 | Gets the value of the specified attribute for this element. 1206 | 1207 | The attribute name to retrieve the value of. 1208 | The value of the attribute. Returns if the attribute does not exist. 1209 | 1210 | 1211 | 1212 | Gets the value of a CSS property of this element. 1213 | 1214 | The property name to retrieve the value of. 1215 | The value of the CSS property. 1216 | 1217 | 1218 | 1219 | Finds the first using the given method. 1220 | 1221 | The locating mechanism to use. 1222 | The first matching on the current context. 1223 | 1224 | 1225 | 1226 | Finds all IWebElements within the current context 1227 | using the given mechanism. 1228 | 1229 | The locating mechanism to use. 1230 | A of all WebElements 1231 | matching the current criteria, or an empty list if nothing matches. 1232 | 1233 | 1234 | 1235 | Determines whether the specified object is equal to the current object. 1236 | 1237 | The object to compare with the current object. 1238 | if the specified object is equal to the current object; otherwise, . 1239 | 1240 | 1241 | 1242 | Serves as a hash function for a particular type. 1243 | 1244 | A hash code for the current object. 1245 | 1246 | 1247 | 1248 | Gets the tag name of this element. 1249 | 1250 | 1251 | 1252 | 1253 | Gets the innerText of this element, without any leading or trailing whitespace, 1254 | and with other whitespace collapsed. 1255 | 1256 | 1257 | 1258 | 1259 | Gets a value indicating whether or not this element is enabled. 1260 | 1261 | 1262 | 1263 | 1264 | Gets a value indicating whether or not this element is selected. 1265 | 1266 | 1267 | 1268 | 1269 | Gets a object containing the coordinates of the upper-left corner 1270 | of this element relative to the upper-left corner of the page. 1271 | 1272 | 1273 | 1274 | 1275 | Gets a object containing the height and width of this element. 1276 | 1277 | 1278 | 1279 | 1280 | Gets a value indicating whether or not this element is displayed. 1281 | 1282 | 1283 | 1284 | 1285 | Gets the location of an element on the screen, scrolling it into view 1286 | if it is not currently on the screen. 1287 | 1288 | 1289 | 1290 | 1291 | Gets the coordinates identifying the location of this element using 1292 | various frames of reference. 1293 | 1294 | 1295 | 1296 | 1297 | Gets the interface through which the user can discover if there is an underlying element to be used. 1298 | 1299 | 1300 | 1301 | 1302 | An implementation of the interface that may have its timeout and polling interval 1303 | configured on the fly. 1304 | 1305 | The type of object on which the wait it to be applied. 1306 | 1307 | 1308 | 1309 | Interface describing a class designed to wait for a condition. 1310 | 1311 | The type of object used to detect the condition. 1312 | 1313 | 1314 | 1315 | Configures this instance to ignore specific types of exceptions while waiting for a condition. 1316 | Any exceptions not whitelisted will be allowed to propagate, terminating the wait. 1317 | 1318 | The types of exceptions to ignore. 1319 | 1320 | 1321 | 1322 | Waits until a condition is true or times out. 1323 | 1324 | The type of result to expect from the condition. 1325 | A delegate taking a TSource as its parameter, and returning a TResult. 1326 | If TResult is a boolean, the method returns when the condition is true, and otherwise. 1327 | If TResult is an object, the method returns the object when the condition evaluates to a value other than . 1328 | Thrown when TResult is not boolean or an object type. 1329 | 1330 | 1331 | 1332 | Gets or sets how long to wait for the evaluated condition to be true. 1333 | 1334 | 1335 | 1336 | 1337 | Gets or sets how often the condition should be evaluated. 1338 | 1339 | 1340 | 1341 | 1342 | Gets or sets the message to be displayed when time expires. 1343 | 1344 | 1345 | 1346 | 1347 | Initializes a new instance of the class. 1348 | 1349 | The input value to pass to the evaluated conditions. 1350 | 1351 | 1352 | 1353 | Initializes a new instance of the class. 1354 | 1355 | The input value to pass to the evaluated conditions. 1356 | The clock to use when measuring the timeout. 1357 | 1358 | 1359 | 1360 | Configures this instance to ignore specific types of exceptions while waiting for a condition. 1361 | Any exceptions not whitelisted will be allowed to propagate, terminating the wait. 1362 | 1363 | The types of exceptions to ignore. 1364 | 1365 | 1366 | 1367 | Repeatedly applies this instance's input value to the given function until one of the following 1368 | occurs: 1369 | 1370 | 1371 | the function returns neither null nor false 1372 | the function throws an exception that is not in the list of ignored exception types 1373 | the timeout expires 1374 | 1375 | 1376 | 1377 | The delegate's expected return type. 1378 | A delegate taking an object of type T as its parameter, and returning a TResult. 1379 | The delegate's return value. 1380 | 1381 | 1382 | 1383 | Throws a with the given message. 1384 | 1385 | The message of the exception. 1386 | The last exception thrown by the condition. 1387 | This method may be overridden to throw an exception that is 1388 | idiomatic for a particular test infrastructure. 1389 | 1390 | 1391 | 1392 | Gets or sets how long to wait for the evaluated condition to be true. The default timeout is 500 milliseconds. 1393 | 1394 | 1395 | 1396 | 1397 | Gets or sets how often the condition should be evaluated. The default timeout is 500 milliseconds. 1398 | 1399 | 1400 | 1401 | 1402 | Gets or sets the message to be displayed when time expires. 1403 | 1404 | 1405 | 1406 | 1407 | Supplies a set of common conditions that can be waited for using . 1408 | 1409 | 1410 | 1411 | IWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3)) 1412 | IWebElement element = wait.Until(ExpectedConditions.ElementExists(By.Id("foo"))); 1413 | 1414 | 1415 | 1416 | 1417 | 1418 | Prevents a default instance of the class from being created. 1419 | 1420 | 1421 | 1422 | 1423 | An expectation for checking the title of a page. 1424 | 1425 | The expected title, which must be an exact match. 1426 | when the title matches; otherwise, . 1427 | 1428 | 1429 | 1430 | An expectation for checking that the title of a page contains a case-sensitive substring. 1431 | 1432 | The fragment of title expected. 1433 | when the title matches; otherwise, . 1434 | 1435 | 1436 | 1437 | An expectation for checking that an element is present on the DOM of a 1438 | page. This does not necessarily mean that the element is visible. 1439 | 1440 | The locator used to find the element. 1441 | The once it is located. 1442 | 1443 | 1444 | 1445 | An expectation for checking that an element is present on the DOM of a page 1446 | and visible. Visibility means that the element is not only displayed but 1447 | also has a height and width that is greater than 0. 1448 | 1449 | The locator used to find the element. 1450 | The once it is located and visible. 1451 | 1452 | 1453 | 1454 | An interface describing time handling functions for timeouts. 1455 | 1456 | 1457 | 1458 | 1459 | Gets the at a specified offset in the future. 1460 | 1461 | The offset to use. 1462 | The at the specified offset in the future. 1463 | 1464 | 1465 | 1466 | Gets a value indicating whether the current date and time is before the specified date and time. 1467 | 1468 | The date and time values to compare the current date and time values to. 1469 | if the current date and time is before the specified date and time; otherwise, . 1470 | 1471 | 1472 | 1473 | Gets the current date and time values. 1474 | 1475 | 1476 | 1477 | 1478 | Interface allows for the component to be used in Nested Component scenarios such that the 1479 | child component class does not have to declare the generic type of the parent explicitly. 1480 | 1481 | 1482 | public class HypotheticalLoadableComponent : LoadableComponent<T> { 1483 | ILoadableComponent parent; 1484 | public HypotheticalLoadableComponent(ILoadableComponent parent) { 1485 | this.parent = parent; 1486 | } 1487 | protected void EvaluateLoadedStatus() { //code to determine loaded state } 1488 | protected void ExecuteLoad() { 1489 | parent.Load(); //loads the parent 1490 | //code to load this component 1491 | } 1492 | } 1493 | 1494 | 1495 | 1496 | 1497 | Loads the component. 1498 | 1499 | A reference to this . 1500 | 1501 | 1502 | 1503 | Represents any abstraction of something that can be loaded. This may be an entire web page, or 1504 | simply a component within that page (such as a login box or menu) or even a service. 1505 | 1506 | The type to be returned (normally the subclass' type) 1507 | 1508 | The expected usage is: 1509 | 1510 | 1511 | new HypotheticalComponent().Load(); 1512 | 1513 | 1514 | 1515 | 1516 | After the method is called, the component will be loaded and 1517 | ready for use. Overload the protected Load and IsLoaded members to both load a component and determine 1518 | if the component is already loaded. 1519 | 1520 | 1521 | 1522 | 1523 | Ensure that the component is currently loaded. 1524 | 1525 | The loaded component. 1526 | This is equivalent to the Get() method in Java version. 1527 | 1528 | 1529 | 1530 | Ensure that the component is currently loaded. 1531 | 1532 | The loaded instance. 1533 | 1534 | 1535 | 1536 | HandleLoadError gives a subclass the opportunity to handle a that occurred 1537 | during the execution of . 1538 | 1539 | The exception which occurs on load. 1540 | 1541 | 1542 | 1543 | When this method returns, the component modeled by the subclass should be fully loaded. This 1544 | subclass is expected to navigate to an appropriate page or trigger loading the correct HTML 1545 | should this be necessary. 1546 | 1547 | 1548 | 1549 | 1550 | Determine whether or not the component is loaded. Subclasses are expected to provide the details 1551 | to determine if the page or component is loaded. 1552 | 1553 | A boolean value indicating if the component is loaded. 1554 | 1555 | 1556 | 1557 | Attempts to load this component, providing an opportunity for the user to handle any errors encountered 1558 | during the load process. 1559 | 1560 | A self-reference to this 1561 | 1562 | 1563 | 1564 | Gets or sets the message for the exception thrown when a component cannot be loaded 1565 | 1566 | 1567 | 1568 | 1569 | Gets a value indicating whether the component is fully loaded. 1570 | 1571 | 1572 | When the component is loaded, this property will return true or false depending on 1573 | the execution of to indicate the not loaded state. 1574 | 1575 | 1576 | 1577 | 1578 | This exception is thrown by to indicate that 1579 | the component was not successfully loaded. 1580 | 1581 | 1582 | 1583 | 1584 | Initializes a new instance of the class. 1585 | 1586 | 1587 | 1588 | 1589 | Initializes a new instance of the class with 1590 | a specified error message. 1591 | 1592 | The message of the exception 1593 | 1594 | 1595 | 1596 | Initializes a new instance of the class with 1597 | a specified error message and a reference to the inner exception that is the 1598 | cause of this exception. 1599 | 1600 | The error message that explains the reason for the exception. 1601 | The exception that is the cause of the current exception, 1602 | or if no inner exception is specified. 1603 | 1604 | 1605 | 1606 | Initializes a new instance of the class with serialized data. 1607 | 1608 | The that holds the serialized 1609 | object data about the exception being thrown. 1610 | The that contains contextual 1611 | information about the source or destination. 1612 | 1613 | 1614 | 1615 | Provides a mechanism by which the window handle of an invoked 1616 | popup browser window may be determined. 1617 | 1618 | 1619 | 1620 | // Store the current window handle so you can switch back to the 1621 | // original window when you close the popup. 1622 | string current = driver.CurrentWindowHandle; 1623 | PopupWindowFinder finder = new PopupWindowFinder(driver); 1624 | string newHandle = finder.Click(driver.FindElement(By.LinkText("Open new window"))); 1625 | driver.SwitchTo.Window(newHandle); 1626 | 1627 | 1628 | 1629 | 1630 | 1631 | Initializes a new instance of the class. 1632 | 1633 | The instance that is used 1634 | to manipulate the popup window. 1635 | When using this constructor overload, the timeout will be 5 seconds, 1636 | and the check for a new window will be performed every 250 milliseconds. 1637 | 1638 | 1639 | 1640 | Initializes a new instance of the class 1641 | with the specified timeout. 1642 | 1643 | The instance that is used 1644 | to manipulate the popup window. 1645 | The representing the amount of 1646 | time to wait for the popup window to appear. 1647 | When using this constructor overload, the check for a new window 1648 | will be performed every 250 milliseconds. 1649 | 1650 | 1651 | 1652 | Initializes a new instance of the class 1653 | with the specified timeout and using the specified interval to check for 1654 | the existence of the new window. 1655 | 1656 | The instance that is used 1657 | to manipulate the popup window. 1658 | The representing the amount of 1659 | time to wait for the popup window to appear. 1660 | The representing the 1661 | amount of time to wait between checks of the available window handles. 1662 | 1663 | 1664 | 1665 | Clicks on an element that is expected to trigger a popup browser window. 1666 | 1667 | The that, when clicked, invokes 1668 | the popup browser window. 1669 | The window handle of the popup browser window. 1670 | Thrown if no popup window appears within the specified timeout. 1671 | Thrown if the element to click is . 1672 | 1673 | 1674 | 1675 | Invokes a method that is expected to trigger a popup browser window. 1676 | 1677 | An that, when run, invokes 1678 | the popup browser window. 1679 | The window handle of the popup browser window. 1680 | Thrown if no popup window appears within the specified timeout. 1681 | Thrown if the action to invoke is . 1682 | 1683 | 1684 | 1685 | Provides a convenience method for manipulating selections of options in an HTML select element. 1686 | 1687 | 1688 | 1689 | 1690 | Initializes a new instance of the SelectElement class. 1691 | 1692 | The element to be wrapped 1693 | Thrown when the object is 1694 | Thrown when the element wrapped is not a <select> element. 1695 | 1696 | 1697 | 1698 | Select all options by the text displayed. 1699 | 1700 | The text of the option to be selected. If an exact match is not found, 1701 | this method will perform a substring match. 1702 | When given "Bar" this method would select an option like: 1703 | 1704 | <option value="foo">Bar</option> 1705 | 1706 | 1707 | Thrown if there is no element with the given text present. 1708 | 1709 | 1710 | 1711 | Select an option by the value. 1712 | 1713 | The value of the option to be selected. 1714 | When given "foo" this method will select an option like: 1715 | 1716 | <option value="foo">Bar</option> 1717 | 1718 | 1719 | Thrown when no element with the specified value is found. 1720 | 1721 | 1722 | 1723 | Select the option by the index, as determined by the "index" attribute of the element. 1724 | 1725 | The value of the index attribute of the option to be selected. 1726 | Thrown when no element exists with the specified index attribute. 1727 | 1728 | 1729 | 1730 | Clear all selected entries. This is only valid when the SELECT supports multiple selections. 1731 | 1732 | Thrown when attempting to deselect all options from a SELECT 1733 | that does not support multiple selections. 1734 | 1735 | 1736 | 1737 | Deselect the option by the text displayed. 1738 | 1739 | The text of the option to be deselected. 1740 | When given "Bar" this method would deselect an option like: 1741 | 1742 | <option value="foo">Bar</option> 1743 | 1744 | 1745 | 1746 | 1747 | 1748 | Deselect the option having value matching the specified text. 1749 | 1750 | The value of the option to deselect. 1751 | When given "foo" this method will deselect an option like: 1752 | 1753 | <option value="foo">Bar</option> 1754 | 1755 | 1756 | 1757 | 1758 | 1759 | Deselect the option by the index, as determined by the "index" attribute of the element. 1760 | 1761 | The value of the index attribute of the option to deselect. 1762 | 1763 | 1764 | 1765 | Gets a value indicating whether the parent element supports multiple selections. 1766 | 1767 | 1768 | 1769 | 1770 | Gets the list of options for the select element. 1771 | 1772 | 1773 | 1774 | 1775 | Gets the selected item within the select element. 1776 | 1777 | If more than one item is selected this will return the first item. 1778 | Thrown if no option is selected. 1779 | 1780 | 1781 | 1782 | Gets all of the selected options within the select element. 1783 | 1784 | 1785 | 1786 | 1787 | A which might not have finished loading when Load() returns. After a 1788 | call to Load(), the IsLoaded property should continue to return false until the component has fully 1789 | loaded. Use the HandleErrors() method to check for error conditions which caused the Load() to fail. 1790 | 1791 |
1792 |             new SlowHypotheticalComponent().Load();
1793 |             
1794 |
1795 |
1796 | The type to be returned (normally the subclass' type) 1797 |
1798 | 1799 | 1800 | Initializes a new instance of the class. 1801 | 1802 | The within which the component should be loaded. 1803 | 1804 | 1805 | 1806 | Initializes a new instance of the class. 1807 | 1808 | The within which the component should be loaded. 1809 | The to use when measuring the timeout. 1810 | 1811 | 1812 | 1813 | Ensures that the component is currently loaded. 1814 | 1815 | The loaded component. 1816 | This is equivalent to the Get() method in Java version. 1817 | 1818 | 1819 | 1820 | Checks for well known error cases, which would mean that loading has finished, but an error 1821 | condition was seen. 1822 | 1823 | 1824 | This method should be overridden so that expected errors can be automatically handled. 1825 | 1826 | 1827 | 1828 | 1829 | Gets or sets the time to sleep between each check of the load status of the component. 1830 | 1831 | 1832 | 1833 | 1834 | Uses the system clock to calculate time for timeouts. 1835 | 1836 | 1837 | 1838 | 1839 | Calculates the date and time values after a specific delay. 1840 | 1841 | The delay after to calculate. 1842 | The future date and time values. 1843 | 1844 | 1845 | 1846 | Gets a value indicating whether the current date and time is before the specified date and time. 1847 | 1848 | The date and time values to compare the current date and time values to. 1849 | if the current date and time is before the specified date and time; otherwise, . 1850 | 1851 | 1852 | 1853 | Gets the current date and time values. 1854 | 1855 | 1856 | 1857 | 1858 | The exception thrown when using the Select class on a tag that 1859 | does not support the HTML select element's selection semantics. 1860 | 1861 | 1862 | 1863 | 1864 | Initializes a new instance of the class with 1865 | the expected tag name and the actual tag name. 1866 | 1867 | The tag name that was expected. 1868 | The actual tag name of the element. 1869 | 1870 | 1871 | 1872 | Initializes a new instance of the class. 1873 | 1874 | 1875 | 1876 | 1877 | Initializes a new instance of the class with 1878 | a specified error message. 1879 | 1880 | The message of the exception 1881 | 1882 | 1883 | 1884 | Initializes a new instance of the class with 1885 | a specified error message and a reference to the inner exception that is the 1886 | cause of this exception. 1887 | 1888 | The error message that explains the reason for the exception. 1889 | The exception that is the cause of the current exception, 1890 | or if no inner exception is specified. 1891 | 1892 | 1893 | 1894 | Initializes a new instance of the class with serialized data. 1895 | 1896 | The that holds the serialized 1897 | object data about the exception being thrown. 1898 | The that contains contextual 1899 | information about the source or destination. 1900 | 1901 | 1902 | 1903 | Provides the ability to wait for an arbitrary condition during test execution. 1904 | 1905 | 1906 | 1907 | IWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3)) 1908 | IWebElement element = wait.Until(driver => driver.FindElement(By.Name("q"))); 1909 | 1910 | 1911 | 1912 | 1913 | 1914 | Initializes a new instance of the class. 1915 | 1916 | The WebDriver instance used to wait. 1917 | The timeout value indicating how long to wait for the condition. 1918 | 1919 | 1920 | 1921 | Initializes a new instance of the class. 1922 | 1923 | An object implementing the interface used to determine when time has passed. 1924 | The WebDriver instance used to wait. 1925 | The timeout value indicating how long to wait for the condition. 1926 | A value indicating how often to check for the condition to be true. 1927 | 1928 |
1929 |
1930 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.Support.2.39.0/lib/net40/WebDriver.Support.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/Selenium.Support.2.39.0/lib/net40/WebDriver.Support.dll -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.WebDriver.2.39.0/Selenium.WebDriver.2.39.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/Selenium.WebDriver.2.39.0/Selenium.WebDriver.2.39.0.nupkg -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.WebDriver.2.39.0/Selenium.WebDriver.2.39.0.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Selenium.WebDriver 5 | 2.39.0 6 | Selenium WebDriver 7 | Selenium Committers 8 | Selenium Committers 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | http://code.google.com/p/selenium/ 11 | http://seleniumhq.org/images/big-logo.png 12 | false 13 | Selenium is a set of different software tools each with a different approach to supporting browser automation. These tools are highly flexible, allowing many options for locating and manipulating elements within a browser, and one of its key features is the support for automating multiple browser platforms. This package contains the .NET bindings for the newer, more concise and object-based Selenium WebDriver API, which uses native OS-level events to manipulate the browser, bypassing the JavaScript sandbox, and does not require the Selenium Server to automate the browser. 14 | .NET bindings for the Selenium WebDriver API 15 | 16 | 17 | 18 | Selenium WebDriver browser automation 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.WebDriver.2.39.0/lib/net35/WebDriver.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/Selenium.WebDriver.2.39.0/lib/net35/WebDriver.dll -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/Selenium.WebDriver.2.39.0/lib/net40/WebDriver.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FriendlyTester/WebDriverFactoryExample/bd8735e937f4ea372b543952a9aea63a3b739cc0/WebDriverDriverFactory/packages/Selenium.WebDriver.2.39.0/lib/net40/WebDriver.dll -------------------------------------------------------------------------------- /WebDriverDriverFactory/packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | --------------------------------------------------------------------------------