As an exercise in learning Selenium WebDriver I am trying to visit the Twitter log in page and log in. I am finally able to navigate to the page and get the desired* element for the username field:
<input class="text-input email-input js-signin-email" name="session[username_or_email]" type="text">
*I have tried to find what types of elements sendKeys
operates with but I can't. I think this element is the one I want since the tag is of the <input>
type.
When I call sendKeys
on the element after assigning it I get an ElementNotInteractableException
. I have tried using explicit waits with the ExpectedConditions
of visibilityOf
and invisibilityOf
. The respective interpretation of the TimeoutException
and ElementNotInteractableException
tells me that the element I mentioned above loads in the DOM tree but never becomes visible*. How do I get around this? Is there a solution using a JavascriptExecutor
?
*The surrounding html might reveal why the element remains invisible:
<form class="t1-form clearfix signin js-signin"
action="https://twitter.com/sessions" method="post">
::before
<fieldset>
<legend class="visuallyhidden">Log in</legend>
<div class="clearfix field">
::before
<input class="text-input email-input js-signin-email"
name="session[username_or_email]" type="text">
.
**For those on the hunt, this question is helpful to look at especially if the issue is caused by the click
method instead.