我有web应用程序,它只工作在边缘浏览器与IE mode.In,我无法自动下拉字段,所以我需要代码,以自动化的下拉字段使用硒web驱动程序。
发布于 2022-04-11 08:42:11
如果我明白你在找什么..。我用C#写的。
using OpenQA.Selenium.Support.UI
IWebElement dropdownElement = driver.FindElement(By.Name("country code"));
//create select element object
SelectElement selectElement = new SelectElement(dropdownElement);
//select by value
selectElement.SelectByValue("NIR");
// select by text
selectElement.SelectByText("Northern Ireland");https://stackoverflow.com/questions/71824884
复制相似问题