So over the weekend I gave a talk at the Ann Arbor PHP User Group about how to ramp up with Selenium testing using PHPUnit. If the video shows this is something of interest for you, please feel free to check out the GitHub repository and get started!
So I put together a quick example of how to go about building your first Selenium test with PHPUnit.
Why PHPUnit? Because there are less moving parts to understand at first.
Remember, the most important part of testing is to have tests to run. You can work on how you build those tests later.
How to act like you (maybe actually) care about your work – Ann Arbor PHP/MySQL Group – November 17th 2012
Here is the video from my talk about how to be a better developer. For more information, check out my page dedicated to the talk.
I was setting up a basic Selenium test setup and ran into a pretty immediate show stopper:
Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: MAC
I hadn’t yet installed Firefox. After I installed it, however, I still continued to get the error.
My googling lead me to this page, and while the advice is generally what needs to happen, I wanted to detail my exact fix, and make life a little simpler for everyone else.
As you can see, the solution is two fold:
- Create a file at ~/bin/firefox with the short script to run firefox. I got unclear errors w/ the source page’s suggestion, and this resolves it.
- Create a ~/.profile to add ~/bin/ to your path.