diff --git a/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml b/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml
index a72405e3..d5873eaa 100644
--- a/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml
+++ b/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml
@@ -149,6 +149,12 @@
String representation of URL.
+
+
+ Navigates to desired URL.
+
+ Desired URL.
+
Navigates back.
diff --git a/Aquality.Selenium/src/Aquality.Selenium/Browsers/Browser.cs b/Aquality.Selenium/src/Aquality.Selenium/Browsers/Browser.cs
index bbd09a25..e35c40d4 100644
--- a/Aquality.Selenium/src/Aquality.Selenium/Browsers/Browser.cs
+++ b/Aquality.Selenium/src/Aquality.Selenium/Browsers/Browser.cs
@@ -171,6 +171,15 @@ public void GoTo(string url)
Navigate().GoToUrl(url);
}
+ ///
+ /// Navigates to desired URL.
+ ///
+ /// Desired URL.
+ public void GoTo(Uri url)
+ {
+ Navigate().GoToUrl(url);
+ }
+
///
/// Navigates back.
///
diff --git a/Aquality.Selenium/src/Aquality.Selenium/Configurations/WebDriverSettings/DriverSettings.cs b/Aquality.Selenium/src/Aquality.Selenium/Configurations/WebDriverSettings/DriverSettings.cs
index f237f740..c70cbc7e 100644
--- a/Aquality.Selenium/src/Aquality.Selenium/Configurations/WebDriverSettings/DriverSettings.cs
+++ b/Aquality.Selenium/src/Aquality.Selenium/Configurations/WebDriverSettings/DriverSettings.cs
@@ -182,7 +182,7 @@ protected void SetLoggingPreferences(DriverOptions options)
{
foreach (var preference in LoggingPreferences)
{
- options.SetLoggingPreference(preference.Key, preference.Value);
+ options.SetLoggingPreference(preference.Key.ToLower(), preference.Value);
}
}
diff --git a/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/DevToolsEmulationTests.cs b/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/DevToolsEmulationTests.cs
index 20531a39..373b8047 100644
--- a/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/DevToolsEmulationTests.cs
+++ b/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/DevToolsEmulationTests.cs
@@ -134,6 +134,7 @@ private static void CheckGeolocationOverride(Action s
Assert.AreEqual(LongitudeForOverride, locationForm.Longitude, "Longitude should match to override value");
clearAction();
+ AqualityServices.Browser.WaitForPageToLoad();
AqualityServices.Browser.Refresh();
locationForm.DetectBrowserGeolocation();
Assert.AreEqual(defaultLatitude, locationForm.Latitude, "Latitude should match to default");
diff --git a/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Usecases/FileDownloadingTests.cs b/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Usecases/FileDownloadingTests.cs
index ceaf7d95..712e141b 100644
--- a/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Usecases/FileDownloadingTests.cs
+++ b/Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/Usecases/FileDownloadingTests.cs
@@ -24,13 +24,22 @@ public void Should_BePossibleTo_DownloadTextFile()
var lblFileContent = AqualityServices.Get().GetLabel(By.XPath("//pre"), "text file content");
Assert.False(FileDownloadHelper.IsFileDownloaded(filePath, lblFileContent), $"file {filePath} should not exist before downloading");
+ var oldWindowHandle = browser.Tabs().CurrentTabHandle;
browser.ExecuteScriptFromFile("Resources.OpenUrlInNewWindow.js", downloaderForm.Url);
- var tabs = new List(AqualityServices.Browser.Driver.WindowHandles);
- browser.Driver.SwitchTo().Window(tabs[1]);
+ browser.Tabs().SwitchToLastTab();
downloaderForm.Open();
- downloaderForm.GetDownloadLink(fileName).JsActions.ClickAndWait();
- browser.Driver.SwitchTo().Window(tabs[0]);
+ var downloadLink = downloaderForm.GetDownloadLink(fileName);
+ if (downloadLink.State.IsDisplayed)
+ {
+ downloadLink.JsActions.ClickAndWait();
+ }
+ else
+ {
+ browser.GoTo(new Uri($"{downloaderForm.Url}/{fileName}"));
+ }
+
+ browser.Tabs().SwitchToTab(oldWindowHandle);
bool condition() => FileDownloadHelper.IsFileDownloaded(filePath, lblFileContent);
var message = $"file {filePath} was not downloaded";
try