TestStack / TestStack.Seleno

Seleno helps you write automated UI tests in the right way by implementing Page Objects and Page Components and by reading from and writing to web pages using strongly typed view models.
http://teststack.github.com/TestStack.Seleno/
MIT License
180 stars 60 forks source link

Running tests with MSTest #242

Closed imilchev closed 8 years ago

imilchev commented 8 years ago

Hi,

I am trying to run my tests by using MSTest's command line interface. The weird thing is that I get an exception that chromedriver.exe cannot be found, while the file is in the folder. I also trying embedding the chromedriver.exe in the DLL containing my tests, the result was the same.

Do you have any suggestions how to fix this?

Thanks in advance!

imilchev commented 8 years ago

Ok I found out that MSTest did not copy the chromedriver.exe to the Out folder. The fix was to use DeploymentItem on the method to force MSTest to copy it. (quite annoying though)

robdmoore commented 8 years ago

Can you please post more detail about the fix so anyone else with the same problem can solve it?

Thanks

On 10 Mar 2016, at 12:30 am, crazybg321 notifications@github.com wrote:

Ok I found out that MSTest did not copy the chromedriver.exe to the Out folder. The fix was to use DeploymentItem on the method to force MSTest to copy it. (quite annoying though)

— Reply to this email directly or view it on GitHub.

imilchev commented 8 years ago

The problem was that MSTest copies the files from the directory of the DLL containing the tests to a Out directory and runs the tests from there and by default it does not include the chromedriver.exe in that folder (don't know why). So the fix was adding the DeploymentItem("chromedriver.exe") attribute on the methods.

With some further investigation I came to the conclusion that it is better to create a base test class that has that attribute and a page object field and all my test classes are extending it (meaning all of them require the chromedriver.exe).