Fix screenshot method

Use writeFile instead of writeFileSync in webdriver writeFile method.