Best Python code snippet using toolium_python
driver_wrapper.py
Source:driver_wrapper.py  
...116        if self.is_mobile_test() and not self.is_web_test() and self.config.getboolean_optional('Driver',117                                                                                                'appium_app_strings'):118            self.app_strings = self.driver.app_strings()119        if self.is_maximizable():120            bounds_x, bounds_y = self.get_config_window_bounds()121            self.driver.set_window_position(bounds_x, bounds_y)122            self.logger.debug('Window bounds: %s x %s', bounds_x, bounds_y)123            if maximize:124                window_width = self.config.get_optional('Driver', 'window_width')125                window_height = self.config.get_optional('Driver', 'window_height')126                if window_width and window_height:127                    self.driver.set_window_size(window_width, window_height)128                else:129                    self.driver.maximize_window()130        window_size = self.utils.get_window_size()131        self.logger.debug('Window size: %s x %s', window_size['width'], window_size['height'])132        self.update_visual_baseline()133        self.utils.discard_logcat_logs()134        if self.config.get('Driver', 'type') != 'ios':135            self.utils.set_implicitly_wait()136        return self.driver137    def get_config_window_bounds(self):138        bounds_x = int(self.config.get_optional('Driver', 'bounds_x') or 0)139        bounds_y = int(self.config.get_optional('Driver', 'bounds_y') or 0)140        monitor_index = int(self.config.get_optional('Driver', 'monitor') or -1)141        if monitor_index > -1:142            try:143                monitor = screeninfo.get_monitors()[monitor_index]144                bounds_x += monitor.x145                bounds_y += monitor.y146            except NotImplementedError:147                self.logger.warn('Current environment doesn\'t support get_monitors')148        return bounds_x, bounds_y149    def is_android_test(self):150        driver_name = self.config.get('Driver', 'type').split('-')[0]151        return driver_name == 'android'...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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
