I have been using Selenium to test the user interface of my AEM site on preview mode. It was done without any technical problem. However, when I try to run selenium test on editor or author mode, such as clicking on a web component to open component dialog, my webdriver is unable to get the web element and throw an exception called org.openqa.selenium.elementnotinteractableexception.
I have tried to solution on StackOverflow, but none of the solution is helpful for what I am doing.
For example, I have something like this on selenium in Java:
WebElement button =
driver.findElement(
By.cssSelector(
"div[data-path='/content/components-examples/library/button/jcr:content/root/responsivegrid/test/component/button']"));
button.click();
The element Not interactable exception is thrown once I try to click on it by using "button.click()". However, if I do the same thing on Preview mode, nothing will happen but the button getting clicked, and no exception will be thrown.
Does AEM support selenium automatic testing on editor or author mode? If it does, how can I overcome this issue?
I wont suggest doing automation testing on AEM author because the components will keep on changing and it will be very difficult to get a particular selector.
For example if you are selecting the button using the cssSelector with data-path, what if the button is changed, few more buttons are added before the particular button you are targeting.
About supporting selenium, I am not sure but for unit testing mockito is mostly used. Hope this helps.