示例#1
0
def selenium_browser_run(script,jalangi=util.DEFAULT_INSTALL):
    selenium_util = load_selenium(jalangi)
    return selenium_util.run_normal(script,jalangi)
import commands
import selenium_util
import util
from selenium.common.exceptions import WebDriverException


script = sys.argv[1]

jalangi = util.DEFAULT_INSTALL

selenium_util.set_chromedriver_loc(os.path.abspath(os.path.join(jalangi.get_home(),
                                                                "thirdparty",
                                                                "chromedriver.exe" if sys.platform == 'win32' else "chromedriver")))

try:
    norm = selenium_util.run_normal(script)
    if norm != "":
        print "something went wrong "
        print norm
        exit(0)
except WebDriverException as e:
    # deliberately printing on stdout,
    # as we don't want this as part of the error message
    print "WebDriverException"
    print e
    exit(0)
    

# instrument file
(instrumented, out) = commands.instrument(os.path.splitext(script)[0])
示例#3
0
def selenium_browser_run(script, jalangi=util.DEFAULT_INSTALL):
    selenium_util = load_selenium(jalangi)
    return selenium_util.run_normal(script, jalangi)
示例#4
0
import selenium_util
import util
from selenium.common.exceptions import WebDriverException

script = sys.argv[1]

jalangi = util.DEFAULT_INSTALL

selenium_util.set_chromedriver_loc(
    os.path.abspath(
        os.path.join(
            jalangi.get_home(), "thirdparty", "chromedriver.exe"
            if sys.platform == 'win32' else "chromedriver")))

try:
    norm = selenium_util.run_normal(script)
    if norm != "":
        print "something went wrong "
        print norm
        exit(0)
except WebDriverException as e:
    # deliberately printing on stdout,
    # as we don't want this as part of the error message
    print "WebDriverException"
    print e
    exit(0)

# instrument file
(instrumented, out) = commands.instrument(os.path.splitext(script)[0])

# instrumented is in same directory as original script