0

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?

Mo0rBy
  • 165
  • 2
  • 15

1 Answers1

1

Have you tried with JavaScriptClick?

D Petkova
  • 111
  • 4
  • Is this the sort of thing you mean? (https://stackoverflow.com/questions/22110282/how-to-click-on-hidden-element-in-selenium-webdriver) Is there not a neater that takes advantage of the BDD style language? – Mo0rBy Jul 14 '22 at 12:21
  • I meant to use JavaScriptClick.on(SearchPage.dateTimePicker_from) which actually behind is doing the same. – D Petkova Jul 14 '22 at 12:59