0
Selenium WebDriver throws Exception in thread “main” 
org.openqa.selenium.ElementNotInteractableException 1 answer
How to resolve ElementNotInteractableException: Element is not visible 
in Selenium webdriver? 3 answers

I tried these two, and got nothing out of them.

This element is input element, and I need to send specific variable to it.

Here is the element:

<input name="ds_nm" id="ds_nm" type="text" size="11" maxlength="40" 
value="ENTER NAME" title="ENTER NAME" class="grayInput" 
onfocus="text_clear()" onblur="text_hint()" 
onkeypress="if(event.keyCode == 13){SearchSano();}">

and here is what I wrote so far:

import time
import requests
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome('./chromedriver')
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.ui import Select
driver = webdriver.Chrome('./chromedriver')
url="ICAN'T SHARE PERSONAL INFO, SORRY"
ConsumerName="MR.Anderson"

driver.get(url)
time.sleep(5)
CN_Insert = driver.find_element_by_css_selector('form#ds_nm')
hov = ActionChains(driver).move_to_element(CN_Insert)
hov.perform()
CN_Insert.clear()
CN_Insert.send_keys(ConsumerName)

I am safely assuming that I need to activate input menu by clicking the placeholder text. But I just can't code it right.

Note

Reposted at the request of Kajal Kundu.

halfer
  • 19,824
  • 17
  • 99
  • 186
NulliPy
  • 133
  • 8
  • Please try to avoid gender assumptions about software engineers, as it can be unwelcoming. We tend to trim greetings and salutations anyway. – halfer Mar 26 '19 at 09:11

1 Answers1

1

I think the problem is python script finish when webdriver didn't load the page .WebDriverWait could help your problem. I will give an example of way of usage.

WebDriverWait(driver, 1000).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "textarea#text")))

The above code will wait 1000 seconds until textarea#text is visible.

Omer Tekbiyik
  • 4,255
  • 1
  • 15
  • 27
  • Sorry if I wasn't thorough with my question- the element is actually input area, where you have to click to make input visible. – NulliPy Feb 23 '19 at 01:00
  • visible mean page loaded. I mean the python script will wait 1000 second until textarea is loaded . It can be anything @NulliPy – Omer Tekbiyik Feb 23 '19 at 01:04