0

I am using the following code to input Email address and password, by clicking the continue element.

However I have no idea should I enter driver.switch_to_frame and then webdriver can enter the email and password and click?

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options=Options()
options.chrome_executable=path="/Users/janice/Desktop/Algo/Selenium/chromedriver.exe"

driver=webdriver.Chrome(options=options)
driver.get("https://system.arthuronline.co.uk/genieliew1/dashboards/index")

2 Answers 2

1

There is no iframe, you can just use the below code:

driver.find_element(By.ID, "username").send_keys("email")
driver.find_element(By.ID, "password").send_keys("password")

driver.find_element(By.XPATH, ".//button[@type='submit']").click()
Sign up to request clarification or add additional context in comments.

Comments

0

It's unclear what is the problem you faced with, why your code didn't work.
Maybe you missind delay to wait for elments to be ready to accept input or click action?
Anyway, the following code works:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

options = Options()
options.add_argument("start-maximized")

webdriver_service = Service('C:\webdrivers\chromedriver.exe')
driver = webdriver.Chrome(service=webdriver_service, options=options)

url = 'https://system.arthuronline.co.uk/genieliew1/dashboards/index'
driver.get(url)
wait = WebDriverWait(driver, 20)

wait.until(EC.element_to_be_clickable((By.ID, 'username'))).send_keys("[email protected]")
wait.until(EC.element_to_be_clickable((By.ID, 'password'))).send_keys("thepassword")
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "button[type='submit']"))).click()

The result is:

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.