I am currently working on a web application where selecting an item from one drop-down list triggers the loading of another. However, when using Selenium to automate this process, I have encountered an issue where the page post back is prevented and the second drop-down does not get loaded. Below are the codes I have tried, including attempting to trigger the onchange
event:
WebElement selectElement = driver.findElement(By.name("ctrlFundTransfer$dropDownListWrittingCompany"));
String change=selectElement.getAttribute("onchange");
System.out.println("List Item " + change);
Select selectw = new Select(selectElement);
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("alert(\"Executing\");"+change+";");
If anyone has insight into how to manage the page postback process in order to successfully load the second drop-down while using Selenium, your assistance would be greatly appreciated.