Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Set path to chromedriver does not work for Nunit while works for UnitTesting #771

Closed
xuejunh opened this issue Feb 20, 2020 · 4 comments
Labels

Comments

@xuejunh
Copy link

xuejunh commented Feb 20, 2020

image
I have 3 tests in the project, I set the following in the App.config:

but only the UnitTesting test passed while other 2 Nunit tests failed at not finding the chromedriver at the temp path

@xuejunh xuejunh added the bug label Feb 20, 2020
@AngelRodriguez8008
Copy link
Contributor

I work also with NUnit, this is another path as MSTest. You should find the right one. Try first an absolute one. Depends also from the runner

@xuejunh
Copy link
Author

xuejunh commented Feb 20, 2020

@AngelRodriguez8008 I do not quite get you. I have the following settings in the App.config:
but my Nunit test is still complaining not find chromedriver in the temp path while UnitTesting test passed. What should I try to make the Nunit tests work with the driverspath set?

@xuejunh
Copy link
Author

xuejunh commented Feb 20, 2020

add key="DriversPath" value="C:\Users\xhuang\source\repos\NunitCRMTestProject\NunitCRMTestProject\bin\Debug"

@AngelRodriguez8008
Copy link
Contributor

AngelRodriguez8008 commented Feb 20, 2020

I guest this comment belongs to this thread.

if(TestSettings.Options.BrowserType == BrowserType.Edge)
{
var edgeDriverPath = @"C:\Windows\SysWOW64";
TestSettings.Options.DriversPath = edgeDriverPath;
}, right? or I can simply set the driverpath in App.config?

If the version of the TestSettings is correct you can simply put the this path in the app.config.

Check this line:

TestSettings:37-38:            
     DriversPath = Path.IsPathRooted(DriversPath) ? DriversPath : Path.Combine(Directory.GetCurrentDirectory(), DriversPath) 

Remember that the Sample Project is no included in the NUGet package. This files will not be updated automatically.

If you change in app.config that will affect all tests

Note: I see that you have Resharper installed, also I. When I use the Reshaper Test Runner
in my NUnit Project; (I have the drivers also in "\bin\Debug" by default installed via NUGet). I don't need to specify the Path in the app.config. I let this empty, but maybe for Edge is different.

this is a Resharper option
image

Look like: VSTest set the Temporary Folder, i will look for more infos about this, check this Issue.

@xuejunh xuejunh closed this as completed Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants