Home > Software engineering >  How to interact with a hidden element using Serenity-BDD
How to interact with a hidden element using Serenity-BDD

Time:07-15

What I want to achieve in my Performable is very simple, but I can't do it due to a hidden element.

I want my actor to:

  • Click on an <input> element
  • Enter a string into that element
  • Then hit <RETURN>

My current code is:

public class Set {
    public static Performable dateFrom(String date) {
        return Task.where("{0} set 'dateFrom' filter to "   date,
            Click.on(SearchPage.dateTimePicker_from),
            Enter.theValue(date).into(SearchPage.dateTimePicker_from)
            .thenHit(RETURN)
        );
    }
}

The exact error I receive when running the test is [main] ERROR - Expected enabled element was not enabled.

I found that this is due to the <input> element being hidden (but there is a <div> element "in-front" of this <input>)

How can I click a hidden element within my Task, without requesting a change from my Dev team?

CodePudding user response:

Have you tried with JavaScriptClick?

  • Related