Fixed some tests to use Selenium and added helper functions