brad
brad

Reputation: 878

Seleniumbase Message: Element <p> is not reachable by keyboard

I am trying to get to the following text area

enter image description here

But I get the error

Message: Element <p> is not reachable by keyboard

I tried both

element = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, ".ql-editor p"))).send_keys(troll_list[rand_troll])

and

wait = WebDriverWait(driver, 30)
wait.until(EC.element_to_be_clickable((By.XPATH, "//*[@id='chat_send-form_textarea']/div[1]/div[1]/p"))).send_keys(troll_list[rand_troll])

And i get the same error

How do I get to this textbox using seleniumbase? I am using the firefox driver.

UPDATE:

This behavior only occurs in Firefox. Chromium is able to find and select the textbox successfully.

Upvotes: 0

Views: 219

Answers (2)

Emmy Beam
Emmy Beam

Reputation: 1

Add div to the css selector path.

element = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.ql-editor p"))).send_keys(troll_list[rand_troll])

When using css selectors, add the tag name before the css path

Upvotes: 0

JaSON
JaSON

Reputation: 4869

You're trying to enter text into p (paragraph) HTML tag which is not designed for that purpose.

You should either locate appropriate <input type="text"> element or <textarea>...

Upvotes: 1

Related Questions