October 26, 2021

Fix "OneTimeSetUp: System.ArgumentNullException : Value cannot be null. (Parameter 'value')" when using Specflow - Selenium

  October 26, 2021

When the method didn't receive enough arguments while execution, we may get System.ArgumentNullException : Value cannot be null

If we are using a combination of Selenium-SpecFlow-NUnit-.Net Core, there will be different scenarios where the following error can occur.

Message: 

    OneTimeSetUp: System.ArgumentNullException : Value cannot be null. (Parameter 'value')

This error will usually be caught in the OneTimeSetUp method in .cs file of the spec flow feature file.

In this case, check the following options to fix this easily.

  • Check the version of  .Net Core (Some versions doest support some arguments of Specflow)
  • Check the Specflow Tools version and Specflow NUnit version are the same
  • Check if the .runsetting file is mapped correctly in Visual studio - Test > Configure Run Settings



logoblog

Thanks for reading Fix "OneTimeSetUp: System.ArgumentNullException : Value cannot be null. (Parameter 'value')" when using Specflow - Selenium

Previous
« Prev Post

No comments:

Post a Comment

Fixing javascript error: Cannot read properties of null (reading 'querySelector') issue when using CSS identifier in selenium

 JavaScript is another way to interact with web elements when normal selenium methods fail to act. But one issue with javascript is, it does...