0

I'm using the latest stable versions of cucumber and serenity, along with the standard chromedriver. I'm having minimal joy trying to show the contents of a select box in my HTML reports.

Here is my HTML code:

<html>
    <head></head>
    <body>
        <select id="inputSelectForAuth">
            <option>Select</option>
            <option>KBA</option>
            <option>SMS</option>
            <option>Phone</option>
            <option>Shared Secret</option>
        </select>
    </body>
</html>

Here is my serenity code (Java):

public void clickAvailableMethodOptions() {
    WebElementFacade XPATH_SELECT = find(ByXPath.xpath("(//select[@id='inputSelectForAuth'])"));
    XPATH_SELECT.click();
    XPATH_SELECT.waitUntilVisible();
}

Which is being called from my step definition file (Java):

@Then("^click on available method options")
public void clickAvailableMethodOptions() {
    commonsUtilPage.clickAvailableMethodOptions();
}

Which is being called from my feature file:

Feature: method options
    scenario: check available method options exist
        Then click on available method options

It's all working fine apart from displaying the options in the screenshot. The select option is focused in the screenshot, as if it had been clicked, it just isn't displaying the list of available options that show up. I can even see them show up when watching chromedriver do it's thing.

khriskooper
  • 767
  • 8
  • 18
  • what report framework are you using? and how do you take the screenshot ? – Infern0 Oct 24 '18 at 17:24
  • I'm using serenity to create the reports, screenshots are taken automatically after each step, in this case on exiting my clickAvailableMethodOptions() method. Even when I explicitly ask to take a screenshot, I still have the same issue. – khriskooper Oct 24 '18 at 17:45
  • Apparently this is a limitation of Selenium, as discussed here: https://stackoverflow.com/questions/33818853/take-screenshot-of-the-options-in-dropdown-in-selenium-c-sharp – khriskooper Oct 29 '18 at 13:50

0 Answers0