예제 #1
0
 def goToUrl(self, url):
     self.statistics.update_teststep()
     helper.browserHelper_log(logging.INFO, f'GoToUrl:{url}',
                              self.browserData)
     try:
         if self.browserName == GC.BROWSER_FIREFOX:
             self.browserData.driver.set_context("content")
         self.browserData.driver.get(url)
         self.setZoomFactor()
     except WebDriverException as e:
         # Use noScreenshot-Parameter as otherwise we'll try on a dead browser to create a screenshot
         helper.browserHelper_log(
             logging.ERROR,
             f"Webpage {url} not reached. Error was: {e}",
             self.browserData,
             cbTakeScreenshot=self.takeScreenshot)
         helper.browserHelper_setProxyError(self.randomProxy)
         raise Exceptions.baangtTestStepException
     except Exception as e:
         # Use noScreenshot-Parameter as otherwise we'll try on a dead browser to create a screenshot
         helper.browserHelper_log(logging.ERROR,
                                  f"Webpage {url} throws error {e}",
                                  self.browserData,
                                  cbTakeScreenshot=self.takeScreenshot)
         helper.browserHelper_setProxyError(self.randomProxy)
         raise Exceptions.baangtTestStepException(url, e)
def test_browserHelper_setProxyError():
    BrowserHelperFunction.browserHelper_setProxyError({
        "ip": "127.0.0.1",
        "port": "4444"
    })
    assert 1 == 1