Navigate menu options

Hello, I have to navigate the menu options using k6 browser module using JS. How to do it?
How can I click on the menu title and choose any menu option.

example:
Animals // let’s call it as title
Cat //option 1
Dog //option2

now I need to write the JS code for navigating to Animals and then click on Dog. How should I do it using k6 browser module?

Hi @chaitanya6,

Please send us a simple HTML page and your script. So we can help figure out the problem.

Since you want to select a menu option, you can use the following API call:

// 1. change selector to your menu item ID or XPATH.
// 2. change values to what you want to select.
page.selectOption(selector, values);

For getting started with browser tests, please take a look this guide.

Thanks.