def execute(self,params): # if len(params) < 1: # print "Instrument requires a filename" # sys.exit(1) parser = OptionParser() (options, args) = parser.parse_args(args=params) (ff,out) = commands.instrument(os.path.abspath(args[0])) print out
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 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()
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 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,