1

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?

1 Answer 1

1

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.

3
  • When you say " the components will keep on changing and it will be very difficult to get a particular selector," do you mean the components will be changed by the author? Or, do you mean AEM keeps on changing the components under the hood?
    – Rongeegee
    Mar 6, 2020 at 14:43
  • Components will be changed by the author
    – Sadistic
    Mar 8, 2020 at 8:28
  • 1
    There's a simple solution or this. To test page templates, and component dialogues, create test content for your develop environment and replace it with every release. Ensure your test automation only tests this example content. Reserve a separate space for manual testing. Ensure you don't deploy the static content to staging or production.
    – Tinman
    Jun 10, 2020 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.