How to use _generic_make_browser method in robotframework-pageobjects

Best Python code snippet using robotframework-pageobjects_python

_browsermanagement.py

Source:_browsermanagement.py Github

copy

Full Screen

...441 else:442 browser = webdriver.Firefox(firefox_profile=profile)443 return browser444 def _make_ie(self , remote , desired_capabilities , profile_dir):445 return self._generic_make_browser(webdriver.Ie,446 webdriver.DesiredCapabilities.INTERNETEXPLORER, remote, desired_capabilities)447 def _make_chrome(self , remote , desired_capabilities , profile_dir):448 return self._generic_make_browser(webdriver.Chrome,449 webdriver.DesiredCapabilities.CHROME, remote, desired_capabilities)450 def _make_opera(self , remote , desired_capabilities , profile_dir):451 return self._generic_make_browser(webdriver.Opera,452 webdriver.DesiredCapabilities.OPERA, remote, desired_capabilities)453 def _make_phantomjs(self , remote , desired_capabilities , profile_dir):454 return self._generic_make_browser(webdriver.PhantomJS,455 webdriver.DesiredCapabilities.PHANTOMJS, remote, desired_capabilities)456 def _make_htmlunit(self , remote , desired_capabilities , profile_dir):457 return self._generic_make_browser(webdriver.Remote,458 webdriver.DesiredCapabilities.HTMLUNIT, remote, desired_capabilities)459 def _make_htmlunitwithjs(self , remote , desired_capabilities , profile_dir):460 return self._generic_make_browser(webdriver.Remote,461 webdriver.DesiredCapabilities.HTMLUNITWITHJS, remote, desired_capabilities)462 def _make_android(self , remote , desired_capabilities , profile_dir):463 return self._generic_make_browser(webdriver.Remote,464 webdriver.DesiredCapabilities.ANDROID, remote, desired_capabilities)465 def _make_iphone(self , remote , desired_capabilities , profile_dir):466 return self._generic_make_browser(webdriver.Remote,467 webdriver.DesiredCapabilities.IPHONE, remote, desired_capabilities)468 def _make_safari(self , remote , desired_capabilities , profile_dir):469 return self._generic_make_browser(webdriver.Safari,470 webdriver.DesiredCapabilities.SAFARI, remote, desired_capabilities)471 def _make_edge(self , remote , desired_capabilities , profile_dir):472 if hasattr(webdriver, 'Edge'):473 return self._generic_make_browser(webdriver.Edge,474 webdriver.DesiredCapabilities.EDGE, remote, desired_capabilities)475 else:476 raise ValueError("Edge is not a supported browser with your version of Selenium python library. Please, upgrade to minimum required version 2.47.0.")477 def _generic_make_browser(self, webdriver_type , desired_cap_type, remote_url, desired_caps):478 '''most of the make browser functions just call this function which creates the479 appropriate web-driver'''480 if not remote_url:481 browser = webdriver_type()482 else:483 browser = self._create_remote_web_driver(desired_cap_type,remote_url , desired_caps)484 return browser485 def _create_remote_web_driver(self , capabilities_type , remote_url , desired_capabilities=None , profile=None):486 '''parses the string based desired_capabilities if neccessary and487 creates the associated remote web driver'''488 desired_capabilities_object = capabilities_type.copy()489 if type(desired_capabilities) in (str, unicode):490 desired_capabilities = self._parse_capabilities_string(desired_capabilities)491 desired_capabilities_object.update(desired_capabilities or {})...

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-pageobjects 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