Esempio n. 1
0
 def set_browser(self):
     if self.remote_webdriver:
         if self.browser == 'chrome':
             desired_capabilities = DesiredCapabilities.CHROME
         else:
             desired_capabilities = DesiredCapabilities.FIREFOX
         self.driver = webdriver.Remote(
             command_executor=self.remote_webdriver + '/wd/hub',
             desired_capabilities=desired_capabilities)
     else:
         if self.browser == 'chrome':
             self.driver = webdriver.Chrome()
         elif self.browser == 'firefox':
             # fp = FirefoxProfile()
             # fp.set_preference("browser.download.folderList", 2)
             # fp.set_preference("browser.download.manager.showWhenStarting", False)
             # fp.set_preference("browser.download.dir", os.path.expanduser("~") + "/Downloads/")
             # fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/zip, application/octet-stream")
             # self.driver = webdriver.Firefox(firefox_profile=fp)
             self.driver = webdriver.Firefox()
         elif self.browser == 'ie':
             self.driver = webdriver.Ie()
         elif self.browser == 'opera':
             self.driver = webdriver.Opera()
         elif self.browser == 'safari':
             self.driver = webdriver.Safari
         else:
             self.fail("Invalid browser configuration [%s]" % self.browser)
Esempio n. 2
0
 def set_browser(self):
     if self.browser == 'chrome':
         self.driver = webdriver.Chrome()
     elif self.browser == 'firefox':
         self.driver = webdriver.Firefox()
     elif self.browser == 'ie':
         self.driver = webdriver.Ie()
     elif self.browser == 'opera':
         self.driver = webdriver.Opera()
     elif self.browser == 'safari':
         self.driver = webdriver.Safari
     else:
         self.fail("Invalid browser configuration [%s]" % self.browser)
Esempio n. 3
0
 def set_browser(self):
     if self.browser == "chrome":
         self.driver = webdriver.Chrome()
     elif self.browser == "firefox":
         self.driver = webdriver.Firefox()
     elif self.browser == "ie":
         self.driver = webdriver.Ie()
     elif self.browser == "opera":
         self.driver = webdriver.Opera()
     elif self.browser == "safari":
         self.driver = webdriver.Safari
     else:
         self.fail("Invalid browser configuration [%s]" % self.browser)
Esempio n. 4
0
 def set_browser(self):
     if self.browser == 'chrome':
         self.driver = webdriver.Chrome()
     elif self.browser == 'firefox':
         #            fp = FirefoxProfile()
         #            fp.set_preference("browser.download.folderList",2)
         #            fp.set_preference("browser.download.manager.showWhenStarting",False)
         #            fp.set_preference("browser.download.dir", os.path.expanduser("~")+"/Downloads/")
         #            fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/zip, application/octet-stream")
         #            self.driver = webdriver.Firefox(firefox_profile=fp)
         self.driver = webdriver.Firefox()
     elif self.browser == 'ie':
         self.driver = webdriver.Ie()
     elif self.browser == 'opera':
         self.driver = webdriver.Opera()
     elif self.browser == 'safari':
         self.driver = webdriver.Safari
     else:
         raise AssertionError("Invalid broswer configuration [%s]" %
                              self.browser)
 def set_browser(self):
     if self.browser == 'chrome':
         self.driver = webdriver.Chrome()
     else:
         self.driver = webdriver.Firefox()