Last active
June 29, 2022 17:37
-
-
Save SarahElson/0e59120a401a1a6685702fc30da6bda6 to your computer and use it in GitHub Desktop.
How To Get Current URL In Selenium Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
class SeleniumPlaygroundPage: | |
#url | |
url = 'https://www.lambdatest.com/selenium-playground/' | |
#locators | |
simple_form_demo = (By.XPATH, "//a[normalize-space()='Simple Form Demo']") | |
# Initializer | |
def __init__(self, browser): | |
self.browser = browser | |
# Interaction methods | |
def load(self): | |
self.browser.get(self.url) | |
def simple_form(self): | |
simple_form = self.browser.find_element(*self.simple_form_demo) | |
simple_form.click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment