Add the get_user_agent() method

This commit is contained in:
Michael Mintz 2020-06-04 03:02:25 -04:00
parent 67ac66b4f2
commit 6c58479cde
2 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,8 @@ self.get_page_source()
self.get_title()
# Duplicates: self.get_page_title()
self.get_user_agent()
self.go_back()
self.go_forward()

View File

@ -423,6 +423,10 @@ class BaseCase(unittest.TestCase):
""" The shorter version of self.get_page_title() """
return self.get_page_title()
def get_user_agent(self):
user_agent = self.driver.execute_script("return navigator.userAgent;")
return user_agent
def go_back(self):
self.__last_page_load_url = None
self.driver.back()