Exemplo n.º 1
0
 def _make_chrome(self, proxy=None):
     cur_path = os.path.dirname(os.path.realpath(__file__))
     cur_path = cur_path + os.sep + ".." + os.sep + 'log' + os.sep + 'chrome.log'
     chrome_capabilities = webdriver.DesiredCapabilities.CHROME
     chrome_capabilities['chromeOptions'] = {
         "args": ["--disable-extensions"],
         "extensions": []
     }
     chrome_capabilities['proxy'] = System.set_proxy(proxy)
     return webdriver.Chrome(
         executable_path=self.__get_driver_path("chrome"),
         desired_capabilities=chrome_capabilities,
         service_log_path=cur_path)
Exemplo n.º 2
0
 def _make_ie(self, proxy=None):
     cur_path = os.path.dirname(os.path.realpath(__file__))
     cur_path = cur_path + os.sep + ".." + os.sep + 'log' + os.sep + 'ie.log'
     ie_capabilities = DesiredCapabilities.INTERNETEXPLORER
     ie_capabilities['ignoreProtectedModeSettings'] = True
     ie_capabilities[
         'INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS'] = True
     ie_capabilities['requireWindowFocus'] = False
     ie_capabilities['enableElementCacheCleanup'] = True
     ie_capabilities['ie.usePerProcessProxy'] = True
     ie_capabilities['proxy'] = System.set_proxy(proxy)
     return webdriver.Ie(executable_path=self.__get_driver_path("ie"),
                         capabilities=ie_capabilities,
                         log_file=cur_path,
                         log_level='INFO')
Exemplo n.º 3
0
 def _make_edge(self, proxy=None):
     if hasattr(webdriver, 'Edge'):
         cur_path = os.path.dirname(os.path.realpath(__file__))
         cur_path = cur_path + os.sep + ".." + os.sep + 'log' + os.sep + 'edge.log'
         edge_capabilities = DesiredCapabilities.EDGE
         edge_capabilities['edge.usePerProcessProxy'] = True
         edge_capabilities['proxy'] = System.set_proxy(proxy)
         # edge_options = Options()
         return webdriver.Edge(
             executable_path=self.__get_driver_path("edge"),
             capabilities=edge_capabilities,
             log_path=cur_path,
             verbose=True)
     else:
         raise ValueError(
             "Edge is not a supported browser with your version of Selenium python library."
             " Please, upgrade to minimum required version 2.47.0.")