def wd(self): log.wd("{0} Starting ...".format(self.name)) if self.name == "FIREFOX": driver = webdriver.Firefox() elif self.name == "CHROME": try: os.environ["webdriver.chrome.driver"] = config.CHROMEDRIVER driver = webdriver.Chrome(config.CHROMEDRIVER) except: return "chromeError" elif self.name == "IE": try: os.environ["webdriver.ie.driver"] = config.IEDRIVER driver = webdriver.Ie(config.IEDRIVER) except: return "IeError" else: return "config.BROWSER Error" log.wd("{0} Started Successfully!".format(self.name)) return driver
def addTS(t=st): time.sleep(t) log.wd("Time Sleep {0} seconds.".format(t))
def addIT(): driver.implicitly_wait(it) log.wd("Implicitly waiting for {0} seconds.".format(it))
def quitAndClear(): time.sleep(st) driver.quit() log.wd("Driver -> Quit & Clear") os.popen("TASKKILL /F /IM IEDriverServer.exe") os.popen("TASKKILL /F /IM chromedriver.exe")