Fixed a bug WRT webdriver initialization and added tests