Framework.ClassUtils.WSelenium package¶
Submodules¶
Framework.ClassUtils.WSelenium.browser_mgmt module¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
Framework.ClassUtils.WSelenium.browser_mgmt.
BrowserManagement
(*args, **kwargs)[source]¶ Bases:
object
Browser management class
-
check_url
(url)[source]¶ To check whether the user provided url is valid or not.
DISCLAIMER: This function internally opens the url to assert the validity of the url.
- Returns:
- status(bool)= True / False.(Whether the url can be reached)
- url : The actual url itself
-
close_tab
(browser_instance=None, tab_number=None, browser_type='firefox')[source]¶ Closing tabs in a browser with unique tab_number
Delete a specific cookie on a specific browser instance
Delete the cookies for a particular browser instance
-
get_firefox_version
(binary)[source]¶ Use firefox binary to find out firefox version before launching firefox in selenium
-
go_back
(browser_instance=None)[source]¶ Simulates the user clicking the “back” button on their browser.
-
go_forward
(browser_instance=None)[source]¶ Simulates the user clicking the “back” button on their browser.
-
go_to
(url, browser_instance=None)[source]¶ Navigates the active browser instance to the provided URL.
-
hard_reload_page
(browser_instance=None)[source]¶ Simulates Refreshing/Reloading the page just as users using F5
-
maximize_browser_window
(browser_instance=None, headless_mode=False)[source]¶ Maximizes current browser window.
-
open_browser
(browser_name='firefox', webdriver_remote_url=False, desired_capabilities=None, **kwargs)[source]¶ Open a browser session
-
open_tab
(browser_instance=None, url=None, browser_type='firefox')[source]¶ Opens a new tab in the browser
-
save_screenshot
(browser_instance=None, filename=None, directory=None)[source]¶ Save screenshot of the specified/current browser
-
set_firefox_proxy
(profile_dir, proxy_ip, proxy_port)[source]¶ method to update the given preferences in Firefox profile
-
set_window_position
(x, y, browser_instance=None)[source]¶ Sets the position x and y of the current window to the specified values.
-
Framework.ClassUtils.WSelenium.element_locator module¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
Framework.ClassUtils.WSelenium.element_locator.
ElementLocator
(*args, **kwargs)[source]¶ Bases:
object
Element Locator class
-
get_element
(browser, locator, **kwargs)[source]¶ Get an element based on the locator and value - By defaults gets a single element, - To get the list of all elements matching the value use findall=’y’ as argument.
Arguments: browser = instance of selenium webdriver browser.
- locator = how to locate the element in the webpage.
supported format: “supported locator value = value for the locator” 1. to locate element by its id:
format = “id=id of the element” eg: “id=j_username” will find the element whose id is j_username
- “name=name of the element”
- “xpath=xpath of the element”
- “link=link to the element”
- “partial_link=partial link to the element”
- “tag=tag of the element”
- “class=class of the element”
- “css=css of the element”
- **kwargs:
- findall = ‘y’ - finds all the elements with matching value
- = None - finds the first elemtn with matching value.
Returns: - the selenium webdriver element if found.
- None if element was not found
(prints a NoSuchElementException message to the user)
-
Framework.ClassUtils.WSelenium.element_operations module¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
Framework.ClassUtils.WSelenium.element_operations.
ElementOperations
(*args, **kwargs)[source]¶ Element operations
-
perform_element_action
(element_or_browser, locator=None, action=None, **kwargs)[source]¶ Generic method to perform specific actions on an element :Currently supported actions and the values that they take if the user provided action is “get_text”, it would return the value of the particular element and the status of it. If not it would return only the status
-
Framework.ClassUtils.WSelenium.verify_operations module¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Framework.ClassUtils.WSelenium.wait_operations module¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
Framework.ClassUtils.WSelenium.wait_operations.
WaitOperations
(*args, **kwargs)[source]¶ Wait operations class
-
wait_until_presence_of_all_elements_located
(browser_instance, locator_type, locator, timeout=5)[source]¶
-
Module contents¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.