The heading says it all: Selenium fails when Chrome is hidden (I use a Mac where you can "hide" running applications) but succeeds when browser is visible.