You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a test which reads an element's text and asserts that it contains the expected results. This text contains newlines.
I am getting different results depending on whether the tests run on macOS or on Windows. The newlines are being modified into the native newline characters (\n or \r\n, respectively).
I would like to configure a newline character to make my tests run consistently.
Note: I am using the .NET bindings, I am unsure if this happens on other bindings or if this is a .NET-specific ask
API proposal:
public class DriverOptions
{
+ public string? NewLine { get; set; }
}
Usage example
stringExpected="Selenium Clients and WebDriver Language Bindings\r\nIn order to create scripts that interact with the Selenium Server (Remote WebDriver) or create local Selenium WebDriver scripts, you need to make use of language-specific client drivers.\r\nWhile language bindings for other languages exist, these are the core ones that are supported by the main project hosted on GitHub.";varoptions=newChromeOptions();options.NewLine="\r\n";// Without this, the test fails when running on macOSusingvardriver=newChromeDriver();driver.Url="https://www.selenium.dev/downloads/";Thread.Sleep(TimeSpan.FromSeconds(5));varparagraph=driver.FindElement(By.XPath("/html/body/div/main/div[2]/div/div")).Text;Assert.That(paragraph,Is.EqualTo(Expected));
The text was updated successfully, but these errors were encountered:
@RenderMichael, thank you for creating this issue. We will troubleshoot it as soon as we can.
Info for maintainers
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template label.
If the issue is a question, add the I-question label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-* label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer label.
Feature and motivation
I have a test which reads an element's text and asserts that it contains the expected results. This text contains newlines.
I am getting different results depending on whether the tests run on macOS or on Windows. The newlines are being modified into the native newline characters (
\n
or\r\n
, respectively).I would like to configure a newline character to make my tests run consistently.
Note: I am using the .NET bindings, I am unsure if this happens on other bindings or if this is a .NET-specific ask
API proposal:
public class DriverOptions { + public string? NewLine { get; set; } }
Usage example
The text was updated successfully, but these errors were encountered: