예제 #1
0
파일: commands.py 프로젝트: xmorgan/jalangi
def selenium_browser_record(filee,
                            instrumented_f,
                            jalangi=util.DEFAULT_INSTALL):
    selenium_util = load_selenium(jalangi)
    print instrumented_f
    real_inst_file = os.path.join(
        os.path.dirname(os.path.abspath(filee + ".js")), instrumented_f)
    return selenium_util.record(real_inst_file, jalangi)
예제 #2
0
def selenium_browser_record(filee, instrumented_f, jalangi=util.DEFAULT_INSTALL):
    selenium_util = load_selenium(jalangi)
    print instrumented_f
    real_inst_file = os.path.join(os.path.dirname(os.path.abspath(filee + ".js")),instrumented_f)
    return selenium_util.record(real_inst_file,jalangi)
예제 #3
0
    # 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
instrumented = os.path.join(os.path.dirname(os.path.abspath(script)),instrumented)

print instrumented

record = selenium_util.record(instrumented)

print record

print "replaying" 
replay_args = ["node","src/js/commands/replay.js"]

sp = subprocess.Popen(replay_args,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = sp.communicate()
print "replay done"
if err:
    print >> sys.stderr, err
    # bingo
    exit(1)

예제 #4
0
    # 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
instrumented = os.path.join(os.path.dirname(os.path.abspath(script)),
                            instrumented)

print instrumented

record = selenium_util.record(instrumented)

print record

print "replaying"
replay_args = ["node", "src/js/commands/replay.js"]

sp = subprocess.Popen(replay_args,
                      stdout=subprocess.PIPE,
                      stderr=subprocess.PIPE)
out, err = sp.communicate()
print "replay done"
if err:
    print >> sys.stderr, err
    # bingo
    exit(1)