web_driver_factory
This module provides the BaseDriverFactory class for creating WebDriver instances.
The BaseDriverFactory class provides methods for creating WebDriver instances based on the specified browser and other parameters.
WebDriverFactory
A class used to create WebDriver instances.
...
Attributes
platform : str the name of the platform
Methods
platform_name(): Returns the name of the platform. selenium_desired_capabilities(browser): Returns the desired capabilities for the specified browser. create_driver(browser, use_grid=None, selenium_grid_ip=None, proxies=None, capabilities=None, chrome_options=None, edge_options=None, firefox_options=None, safari_options=None, custom_experimental_options=None, ie_edge_clear_browser_history=False, firefox_preferences=None, grid_directory_path=None, chrome_version=None, project_path=None): Creates a WebDriver instance based on the specified parameters.
Source code in libs\cafex_ui\src\cafex_ui\web_client\web_driver_factory.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
__init__()
Constructs all the necessary attributes for the BaseDriverFactory object.
Source code in libs\cafex_ui\src\cafex_ui\web_client\web_driver_factory.py
43 44 45 46 |
|
create_driver(browser, use_grid=None, selenium_grid_ip=None, proxies=None, capabilities=None, browser_version=None, chrome_options=None, chrome_preferences=None, firefox_options=None, firefox_preferences=None, safari_options=None, ie_and_edge_clear_browser_history=False, edge_options=None, ie_options=None, run_on_browserstack=False, browserstack_username=None, browserstack_access_key=None, browserstack_capabilities=None)
Creates a WebDriver instance.
The method creates a WebDriver instance based on the specified parameters.
Parameters
browser : str
the name of the browser
use_grid : bool, optional
a flag indicating whether to use grid execution (default is None)
selenium_grid_ip : str, optional
the IP of the Selenium grid (default is None)
proxies : str, optional
the proxies to be used (default is None)
capabilities : dict, optional
the capabilities to be used (default is None)
chrome_options : list, optional
a list of Chrome options to be set (default is None)
chrome_preferences : dict, optional
a dictionary of Chrome preferences to be set (default is None)
firefox_options : list, optional
a list of Firefox options to be set (default is None)
firefox_preferences : dict, optional
a dictionary of Firefox preferences to be set (default is None)
edge_options : list, optional
a list of Edge options to be set (default is None)
safari_options : list, optional
a list of Safari options to be set (default is None)
ie_and_edge_clear_browser_history : bool, optional
a flag indicating whether to clear browser history for IE Edge (default is False)
browser_version : str, optional
the version of browser to be used (default is None)
ie_options : list, optional
a list of IE options to be set (default is None)
run_on_browserstack : bool, optional
a flag indicating whether to run on BrowserStack (default is False)
browserstack_username : str, optional
the username for BrowserStack (default is None)
browserstack_access_key : str, optional
the access key for BrowserStack (default is None)
browserstack_capabilities : dict, optional
a dict of BrowserStack capabilities to be set (default is None)
Returns
driver_ : WebDriver
the created WebDriver instance
Source code in libs\cafex_ui\src\cafex_ui\web_client\web_driver_factory.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
platform_name()
classmethod
Returns the name of the platform.
The method returns the name of the platform based on the platform attribute of the BaseDriverFactory object.
Returns
platform_name : str
the name of the platform
Source code in libs\cafex_ui\src\cafex_ui\web_client\web_driver_factory.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
selenium_desired_capabilities(browser)
staticmethod
Returns the desired capabilities for the specified browser.
The method returns the desired capabilities for the specified browser.
Parameters
browser : str
the name of the browser
Returns
browser_capabilities : dict
the desired capabilities for the specified browser
Source code in libs\cafex_ui\src\cafex_ui\web_client\web_driver_factory.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|