Currently, I am attempting to create a Selenium test that involves selecting an item from 2 dropdown menus and then clicking a button. However, I have encountered an issue where the second dropdown menu is populated based on an angularjs call depending on the selection made in the first dropdown. Strangely, the angular call fails to execute when the value changes, resulting in the second list not being populated and causing an error. Why does the angularjs call fail to run when the value changes?
Here's a snippet of the dropdown:
<select id="itemList" style="width:495px;" onchange="angular.element($(this)).scope().itemChanged(this);">
<option value="item1">Item 1</option>
<option value="item2">Item 2</option>
<option value="item3">Item 3</option>
</select>
Selenium script:
SelectElement item = new SelectElement(driver.FindElement(By.Id("itemList")));
item.SelectByText("Item 2");
Although the code successfully selects an item from the first dropdown, the angular call responsible for populating the second dropdown fails to execute. How can I ensure that this call runs as expected?