Get Browser Information with Intern
You know how you can't remember something your spouse feels is really important but you can remember every funny line from that movie you saw when you were 17? That's how I feel after months of writing selenium tests using the Intern framework -- I've forgotten lots of important front-end stuff but I've uncovered loads of selenium issues and techniques to hack around them.
I initially wrote my tests using Firefox as the test browser. Then I opened up my testing to Chrome and needed to adjust a whole bunch of stuff because Chrome doesn't reliably do things like Firefox, like element `click` vs. `enter` key press. And don't ask me about concurrency issues. Then today I had the bright idea of adding Safari to the mix. In a word....f*ck. A whole new world of issues cropped up.
One issue that Selenium + Safari has (one of dozens) is history / URL issues. After doing loads of research and implementing every hack I could think of, I had this moment:
If there's a Selenium issue in a given browser that makes it impossible for a test to complete properly, there's no point in fighting it -- this case calls for simply passing the test instead of dealing with the annoyance of seeing a failure due to Selenium error. But how do you get browser information within a test?
The session object on the remote provides information about the browser session, including the name (most important) as well as fixes provided by Intern.