How to use _set_output_format method in robotframework-appiumlibrary

Best Python code snippet using robotframework-appiumlibrary_python

pacasusall.py

Source:pacasusall.py Github

copy

Full Screen

...57 score = CustomScore(self.logger, self.settings)58 else:59 raise InvalidOptionException(matrix_name + ' is not a valid substitution matrix')60 self.score = score61 def _set_output_format(self):62 '''Determines the output format.63 Currently only TXT for text and SAM for SAM are supported.64 '''65 if self.settings.out_format.upper() == 'FASTA':66 self.output_format = 'FASTA'67 else:68 raise InvalidOptionException('Invalid output format {0}.'.format(self.settings.out_format))69 def _set_program(self):70 '''Determines what program from the suite should be used and instantiates it'''71 if self.settings.program == "palindrome":72 self.program = Palindrome(self.logger, self.score, self.settings)73 self.logger.warning("Forcing output to FASTA")74 self.output_format = "FASTA"75 self.logger.warning("Forcing query step to 1")76 self.settings.query_step = "1"77 self.logger.warning("Forcing sequence step to 1")78 self.settings.sequence_step = "1"79 self.logger.warning("Forcing Matrix to PALINDROME")80 self.settings.matrix_name = "PALINDROME"81 self.score = PalindromeScore(self.logger, self.settings)82 else:83 raise InvalidOptionException('Invalid program selected {0}'.format(self.settings.program))84 def run(self):85 '''The main program of pyPaSWAS.'''86 # Read command-line arguments87 self.settings, self.arguments = parse_cli(self.config_file)88 self.logger = set_logger(self.settings)89 self.logger.info("Initializing application...")90 self._set_outfile()91 self._set_scoring_matrix()92 self.logger.info('Application initialized.')93 self.logger.info('Setting program...')94 self._set_output_format()95 self._set_program()96 self.logger.info('Program set.')97 98 queriesToProcess = True99 100 query_start = int(self.settings.start_query)101 query_end = int(self.settings.start_query) + int(self.settings.query_step)102 if query_end > int(self.settings.end_query) and int(self.settings.start_query) != int(self.settings.end_query):103 query_end = int(self.settings.end_query)104 105 start_index = int(self.settings.start_target)106 end_index = int(self.settings.start_target) + int(self.settings.sequence_step) 107 if end_index > int(self.settings.end_target) and int(self.settings.start_target) != int(self.settings.end_target):108 end_index = int(self.settings.end_target)...

Full Screen

Full Screen

_screenrecord.py

Source:_screenrecord.py Github

copy

Full Screen

...25 | `Stop Screen Recording` | filename=output | # saves the recorded session |26 """27 timeLimit = robot.utils.timestr_to_secs(timeLimit)28 options['timeLimit'] = timeLimit29 self._output_format = self._set_output_format() \30 if self._output_format is None else self._output_format31 if self._recording is None:32 self._recording = self._current_application().start_recording_screen(**options)33 def stop_screen_recording(self, filename=None, **options):34 """Gathers the output from the previously started screen recording \35 to a media file, then embeds it to the log.html(only on Android).36 Requires an active or exhausted Screen Recording Session.37 See `Start Screen Recording` for more details.38 Example:39 | `Start Screen Recording` | | # starts a screen record session |40 | .... keyword actions | | |41 | `Stop Screen Recording` | filename=output | # saves the recorded session |42 """43 if self._recording is not None:44 self._recording = self._current_application().stop_recording_screen(**options)45 return self._save_recording(filename)46 else:47 raise RuntimeError("There is no Active Screen Record Session.")48 def _save_recording(self, filename):49 path, link = self._get_screenrecord_paths(filename)50 decoded = base64.b64decode(self._recording)51 with open(path, 'wb') as screenrecording:52 screenrecording.write(decoded)53 # Embed the Screen Recording to the log file54 # if the current platform is Android.55 if self._is_android():56 self._html('</td></tr><tr><td colspan="3"><a href="{vid}">'57 '<video width="800px" controls>'58 '<source src="{vid}" type="video/mp4">'59 '</video></a>'.format(vid=link)60 )61 self._recording = None62 return path63 def _set_output_format(self):64 return '.ffmpeg' if self._is_ios() else '.mp4'65 def _get_screenrecord_paths(self, filename=None):66 if filename is None:67 self._screenrecord_index += 168 filename = 'appium-screenrecord-{index}{ext}'.format(index=self._screenrecord_index,69 ext=self._output_format70 )71 else:72 filename = (filename.replace('/', os.sep)) + self._output_format73 logdir = self._get_log_dir()74 path = os.path.join(logdir, filename)75 link = robot.utils.get_link_path(path, logdir)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run robotframework-appiumlibrary automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful