mercredi 9 octobre 2019

How to select multiple options for select drop down using test cafe?

I have a drop-down on a page with multi-select set to true. I am trying to write a testcafe test wherein at first I select one option from this select drop down and then assert that a table, say projectTable, only has a single row. Then I have to add another option from the drop-down and now the projectTable should have two rows. Then, I will go ahead and clear all the selected options and test for more conditions. I am facing problem due to the HTML structure of the page and the select drop-down. It seems like I must click somewhere first to make the options visible before trying to click options.

Here's the HTML code for the select drop down: enter image description here

I have tried to first select the drop-down using the 'projects_filter' id and then try to access 'options' but that piece of code ends up in an error saying 'options are not visible'. I have tried first selecting the 'input' search, entering the string that I wish to search and then try to click an option but that results in visibility error.

So, could someone help me out here? Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire