react issue - cannot fill react input field

32 views
Skip to first unread message

medv...@gmail.com

unread,
Dec 4, 2018, 5:50:15 AM12/4/18
to Geb User Mailing List
hi,

I have following input field which I would like to fill:

2018-12-04 11_42_30-Clipboard.png


Chrome's react dev tooll shows this field like this:


2018-12-04 11_44_17-Clipboard.png


I tried to click this input field first then fill it, but I always get


org.openqa.selenium.InvalidElementStateException: invalid element state: Element is not currently interactable and may not be manipulated


I tried to click it with perform

   WebElement element = driver.findElement(By.cssSelector('div.rt-tr > .email-cell[tabIndex="-1"] > input'));
new Actions(driver).moveToElement(element).perform();

but no help.


I try to fill it 

mailFilterInputField.value("customer_temporary")

on the Page (mailFilterInputField{$('div.rt-tr > .email-cell[tabIndex="-1"] > input')})

but the object not accessable.


could please someone help me?


thank you in advance,

Roland

Martin de laat

unread,
Dec 4, 2018, 10:56:43 AM12/4/18
to Geb User Mailing List
Haven't fully read your message. Sorry.

But if you wish to click it, why not
$("your_selector").click()

Regardless, your statement just moves the mouse there without clicking it, try: 
moveToElement(element).click().perform()

medv...@gmail.com

unread,
Dec 5, 2018, 7:11:15 AM12/5/18
to Geb User Mailing List
I always get 
org.openqa.selenium.InvalidElementStateException: invalid element state: Element is not currently interactable and may not be manipulated
when I want to fill the input field.

assert($('div.rt-table > div.rt-thead.-filters > div.rt-tr').displayed)
is true, but 
$('div.rt-table > div.rt-thead.-filters > div.rt-tr > div[class="rt-th email-cell"] > input')
is simply not displayed and I get the error message above.

HTML code:

2018-12-05 13_08_47-Clipboard.png


same element using React Dev Tool:

2018-12-05 13_10_22-Clipboard.png


any idea or hint how I could fill this input field?

Trinidad Esparza

unread,
Dec 5, 2018, 5:49:42 PM12/5/18
to Geb User Mailing List
Silly question but the fields look gray which in many cases this means that this fields are disabled, can you type text manually ? if so I would try something like this.. 


waitFor {
$('div.email-cell > input').displayed 
$('div.email-cell > input') << "yourEmailAddress"
 
good luck

Martin de laat

unread,
Dec 6, 2018, 2:51:48 AM12/6/18
to Geb User Mailing List
Sorry no experience with react, but:
It looks like the field is disabled. What does the user do to enable it? Click on it? Then do so in your tests. 
I'd argue that your objective is not to fill the field in your test, your objective is to mimic the user's behaviour, and that will solve your problem as well I reckon.
Reply all
Reply to author
Forward
0 new messages