Added selenium tests.

Moved session functions into utility method.