I seem to be facing a strange issue with protractor.
My challenge lies in testing a form that is situated within a modal. Although I am able to verify that the modal is indeed open, I encounter difficulties when attempting to sendKeys to the input fields.
element(by.id('modal')).click().then(function () {
var modal = $('.modal');
browser.wait(EC.visibilityOf(modal), 5000);
expect(modal.isDisplayed()).toBeTruthy();
element(by.model('userInput.firstName')).sendKeys('HELLO'); // <- this fails
})
This test consistently fails with an ElementNotVisibleError. However, if I configure the modal to automatically open once the page loads (rather than upon clicking a button), ensuring that the modal is visible and then sending the keys works without any issues.
I would greatly appreciate any guidance or advice on how to resolve this issue.