I want to get all the elements in a v-select dropdown menu and put them in to a list. To do this I should locate the dropdown menu field firstly. My questions are below:
1.When I want to locate the dropdown menu it can't be found in Cypress but when I locate it in the web page in the filter elements field then it can be located. So how can I locate the dropdown menu? I can share the screenshot below:
I can find it in the website filter elements filed as the picture
but it failed to dind it in Cypress And I used force click in cypress as the dropdown menu field is non-visible.
- I can't locate the li elements under the ul which contains the elements that I want to collect in a list. I can share the screenshots about the elements:
[According to the picture I tried to find out the dropdown menu section and force click it and then try to find out the elements that I want] (https://i.stack.imgur.com/7hzdM.jpg)
cy.get('#vs14__listbox').click({force:true}).trigger('mousedown');
cy.get('#vs14__listbox>li').contains('Ankara').click();
I tried this code but it doesn't work at all. How can I get the li elements under the ul above?
There's not enough detail in the question to say why you can't find the
<ul>listbox.But working with a general example it's easy enough to get the options. This example test may help you overcome some issues.