I use Selenium Firefox Driver in C#. On the website it test there is a div. When i click the div, it shows the other div that has contenteditable (so it’s like input but text is in the inner of the div).
I need to test it with Selenium, but when i click the div the second one is not displayed. And when i try to change the inner of the second div Selenium returns error that it can not interact with invisible elements.
So i tried to use document.evaluate to call JavaScript to find the div with the class name (it has not have id) and to remove the display attribute. But than i have error because since the div is invisible it is not in the DOM.
How to put the text into second div properly from Selenium Firefox WebDriver?
Check the locator you’re using to find your first div. Most likely it’s incorrect, so you’re not actually clicking on the first div and therefore the second one is never becoming visible.
To find a div using its classname, use
"css=div[class='className']"