L'elemento <input> non è raggiungibile da tastiera - InputField sotto ShadwoRoot

0

Domanda

Io uso più recente di Chrome e chromedriver.
Ho un sito web con elementi del DOM e io digitare il testo in un inputfield
Codice HTML (scusate per l'immagine) enter image description here

Codice Python:
#Espandere Ombra
def expand_shadow_element(elemento):
shadow_root = driver.execute_script ("return arguments[0].shadowRoot.bambini', elemento)
ritorno shadow_root
...
root1 = driver.find_element_by_id("UI-tf_Vorgangsname")
shadow_root1 = expand_shadow_element(root1)
root2 = shadow_root11.find_element_by_xpath("//input[@part='valore']")
tempo.sleep(2)
root2.fare clic su()
tempo.sleep(2)
root2.send_keys('testssdfs')

Diventare questo messaggio:
selenio.comune.le eccezioni.ElementNotInteractableException: Messaggio: Elemento non è raggiungibile da tastiera

Vedo, fare clic su sta lavorando, cursore è aktiv nel Campo di Input, ma send_keys non funziona.
enter image description here
Avete qualche idea?
Molte Grazie!

dom input selenium-webdriver sendkeys
2021-11-23 12:01:12
1

Migliore risposta

0

Ho una soluzione.
Sendkeys non funziona, ma ho trovato una soluzione ibrida.
Io uso questo script Python senza send_keys, e io uso robotframework kernsystem.
xy.robot file
...
${Elemento}= Ottenere l'ID dell'Elemento di Input -interfaccia utente tf_Vorgnagsname
Premere i Tasti ${Elemento} testo di Prova
...
Così posso scrivere nel campo di immissione.

2021-11-25 14:10:51

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................