diff --git a/Plugins/SpecFlow.Actions.BoaConstrictor/Example/Example.csproj b/Plugins/SpecFlow.Actions.BoaConstrictor/Example/Example.csproj index 4e4dae52..4717219b 100644 --- a/Plugins/SpecFlow.Actions.BoaConstrictor/Example/Example.csproj +++ b/Plugins/SpecFlow.Actions.BoaConstrictor/Example/Example.csproj @@ -16,9 +16,9 @@ + - - + @@ -33,7 +33,7 @@ - + diff --git a/Plugins/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor.csproj b/Plugins/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor.csproj index 6cfb17f7..a4b8918f 100644 --- a/Plugins/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor.csproj +++ b/Plugins/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor/SpecFlow.Actions.BoaConstrictor.csproj @@ -9,7 +9,7 @@ - + diff --git a/Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker.IntegrationTests/SpecFlow.Actions.Docker.IntegrationTests.csproj b/Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker.IntegrationTests/SpecFlow.Actions.Docker.IntegrationTests.csproj index a5ebdbd3..c84aabd0 100644 --- a/Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker.IntegrationTests/SpecFlow.Actions.Docker.IntegrationTests.csproj +++ b/Plugins/SpecFlow.Actions.Docker/SpecFlow.Actions.Docker.IntegrationTests/SpecFlow.Actions.Docker.IntegrationTests.csproj @@ -8,7 +8,7 @@ - + diff --git a/Plugins/SpecFlow.Actions.LambdaTest/SpecFlow.Actions.LambdaTest.IntegrationTests/SpecFlow.Actions.LambdaTest.IntegrationTests.csproj b/Plugins/SpecFlow.Actions.LambdaTest/SpecFlow.Actions.LambdaTest.IntegrationTests/SpecFlow.Actions.LambdaTest.IntegrationTests.csproj index 05e43608..a985372a 100644 --- a/Plugins/SpecFlow.Actions.LambdaTest/SpecFlow.Actions.LambdaTest.IntegrationTests/SpecFlow.Actions.LambdaTest.IntegrationTests.csproj +++ b/Plugins/SpecFlow.Actions.LambdaTest/SpecFlow.Actions.LambdaTest.IntegrationTests/SpecFlow.Actions.LambdaTest.IntegrationTests.csproj @@ -15,7 +15,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.IntegrationTests/SpecFlow.Actions.Selenium.IntegrationTests.csproj b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.IntegrationTests/SpecFlow.Actions.Selenium.IntegrationTests.csproj index e922fb71..52997a1c 100644 --- a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.IntegrationTests/SpecFlow.Actions.Selenium.IntegrationTests.csproj +++ b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.IntegrationTests/SpecFlow.Actions.Selenium.IntegrationTests.csproj @@ -15,10 +15,8 @@ - - @@ -32,7 +30,7 @@ - + diff --git a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverInitialiser.cs b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverInitialiser.cs index 6bafcb59..4a44b7b7 100644 --- a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverInitialiser.cs +++ b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverInitialiser.cs @@ -44,6 +44,7 @@ private void AddArgumentsFromConfiguration(T options) { if (_seleniumConfiguration.Arguments.Any()) { + DriverOptionsHelper.TryToAddArguments(options, _seleniumConfiguration.Arguments); options.TryToAddArguments(_seleniumConfiguration.Arguments); } } diff --git a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverOptionsHelper.cs b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverOptionsHelper.cs index 955b15d7..518b7b83 100644 --- a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverOptionsHelper.cs +++ b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/DriverInitialisers/DriverOptionsHelper.cs @@ -18,39 +18,47 @@ public static void TryToAddGlobalCapability(this T options, string name, stri switch (options) { case FirefoxOptions firefoxOptions: - firefoxOptions.AddAdditionalCapability(name, value, true); + firefoxOptions.AddAdditionalFirefoxOption(name, value); break; case ChromeOptions chromeOptions: - chromeOptions.AddAdditionalCapability(name, value, true); + chromeOptions.AddAdditionalChromeOption(name, value); break; default: - options.AddAdditionalCapability(name, value); + options.AddAdditionalOption(name, value); break; } } public static void TryToAddArguments(this T options, string[] arguments) where T : DriverOptions { - switch (options) + try { - case FirefoxOptions firefoxOptions: - firefoxOptions.AddArguments(arguments); - break; - case ChromeOptions chromeOptions: - chromeOptions.AddArguments(arguments); - break; - case EdgeOptions edgeOptions: - edgeOptions.AddAdditionalCapability("args", arguments.ToList()); - break; - case InternetExplorerOptions internetExplorerOptions: - internetExplorerOptions.AddAdditionalCapability("args", arguments.ToList()); - break; - case SafariOptions safariOptions: - safariOptions.AddAdditionalCapability("args", arguments.ToList()); - break; - default: - throw new NotImplementedException(nameof(TryToAddArguments) + " is not implemented for " + - options.GetType().Name); + + switch (options) + { + case FirefoxOptions firefoxOptions: + firefoxOptions.AddArguments(arguments); + break; + case ChromeOptions chromeOptions: + chromeOptions.AddArguments(arguments); + break; + case EdgeOptions edgeOptions: + edgeOptions.AddAdditionalEdgeOption("args", arguments.ToList()); + break; + case InternetExplorerOptions internetExplorerOptions: + internetExplorerOptions.AddAdditionalInternetExplorerOption("args", arguments.ToList()); + break; + case SafariOptions safariOptions: + safariOptions.AddAdditionalOption("args", arguments.ToList()); + break; + default: + throw new NotImplementedException(nameof(TryToAddArguments) + " is not implemented for " + + options.GetType().Name); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); } } } diff --git a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.csproj b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.csproj index 2c502cd9..59e01de1 100644 --- a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.csproj +++ b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium.csproj @@ -10,7 +10,7 @@ - + diff --git a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/WebElementExtensions.cs b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/WebElementExtensions.cs index c99df096..8be62cee 100644 --- a/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/WebElementExtensions.cs +++ b/Plugins/SpecFlow.Actions.Selenium/SpecFlow.Actions.Selenium/WebElementExtensions.cs @@ -162,7 +162,7 @@ public static IEnumerable WhereElementsAreDisplayed(this IEnumerabl /// public static IEnumerable WhereElementsHavePropertyValue(this IEnumerable webElements, string propertyName, string value) { - return webElements.Where(element => element.GetProperty(propertyName).Equals(value)); + return webElements.Where(element => element.GetDomProperty(propertyName).Equals(value) || element.GetDomAttribute(propertyName).Equals(value)); } /// diff --git a/Plugins/Specflow.Actions.Browserstack/SpecFlow.Actions.Browserstack.IntegrationTests/Specflow.Actions.Browserstack.IntegrationTests.csproj b/Plugins/Specflow.Actions.Browserstack/SpecFlow.Actions.Browserstack.IntegrationTests/Specflow.Actions.Browserstack.IntegrationTests.csproj index 3e96ac50..538af2d3 100644 --- a/Plugins/Specflow.Actions.Browserstack/SpecFlow.Actions.Browserstack.IntegrationTests/Specflow.Actions.Browserstack.IntegrationTests.csproj +++ b/Plugins/Specflow.Actions.Browserstack/SpecFlow.Actions.Browserstack.IntegrationTests/Specflow.Actions.Browserstack.IntegrationTests.csproj @@ -15,7 +15,7 @@ - + @@ -30,7 +30,7 @@ - +