Exemplo n.º 1
0
 def getCurrentChromeVersion():
     if constant.config['os'] == 'linux':
         currentChromeVersion = Utils.shellCall(
             '/usr/bin/google-chrome --version')
         return int(
             float(
                 re.findall('([0-9][0-9]\.[0-9])',
                            currentChromeVersion)[0]))
     else:
         spath = r'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
         cargs = [
             "wmic", "datafile", "where", r'name="{0}"'.format(spath),
             "get", "Version", "/value"
         ]
         process = subprocess.check_output(cargs)
         currentChromeVersion = process.strip().decode()
         return int(
             float(
                 re.findall('([0-9][0-9]\.[0-9])',
                            currentChromeVersion)[0]))
Exemplo n.º 2
0
 def getCurrentChromeDriverVersion():
     currentChromeDriverVersion = Utils.shellCall(
         constant.chromeDriverPath + ' --version')
     return float(
         re.findall('([0-9]\.[0-9][0-9])', currentChromeDriverVersion)[0])