- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.6k
 
Closed
Labels
C-dotnet.NET Bindings.NET BindingsI-defectSomething is not working as intendedSomething is not working as intended
Description
What happened?
Following API (at least for Edge and Firefox drivers, but I suspect others too) allow user to pass optional driver path (and executable name) or at least doesn't assert it is specified:
With NRT annotations enabled in 4.29.0 they now generate build error when nullable parameter passed.
How can we reproduce the issue?
class Test
{
    public DriverService Create(string? optionalPathToDriver, string? exeName, bool isEdge)
    {
        // Possible null reference argument for parameter 'driverPath' in 'FirefoxDriverService FirefoxDriverService.CreateDefaultService(string driverPath)'.
        // Possible null reference argument for parameter 'driverPath' in 'EdgeDriverService EdgeDriverService.CreateDefaultService(string driverPath, string driverExecutableFileName)'.
        return isEdge
            ? EdgeDriverService.CreateDefaultService(optionalPathToDriver, exeName)
            : FirefoxDriverService.CreateDefaultService(optionalPathToDriver, exeName);
    }
}Relevant log output
irrelevantOperating System
irrelevant
Selenium version
4.29.0 [.NET]
What are the browser(s) and version(s) where you see this issue?
irrelevant
What are the browser driver(s) and version(s) where you see this issue?
irrelevant
Are you using Selenium Grid?
No response
Metadata
Metadata
Assignees
Labels
C-dotnet.NET Bindings.NET BindingsI-defectSomething is not working as intendedSomething is not working as intended