[英]kendoMultiSelect: Java Selenium How to select multiple values?
I am trying to select multiple values from a kendoMultiSelect, I can't interact it with the Selenium methods.我正在尝试 select 来自 kendoMultiSelect 的多个值,我无法与 Selenium 方法进行交互。 I guess i need to use javascript execute function.
我想我需要使用 javascript 执行 function。 What function should i use?
我应该使用什么 function?
Yes javascript execute function will be your safest bet.是的 javascript 执行 function 将是您最安全的选择。
To use it in selenium you need to use the JavascriptExecutor
interface of a driver.要在 selenium 中使用它,您需要使用驱动程序的
JavascriptExecutor
接口。
// Use your existing driver here
WebDriver driver= new FirefoxDriver();
//JavascriptExecutor interface object by casting
JavascriptExecutor js = (JavascriptExecutor)driver;
//executeAsyncScript() method with your JS
js.executeAsyncScript("kendoMultiSelect.value(["Value 1","Value 2"]);");
The kendoMultiSelect
variable is a JS variable that references your instance of the select. kendoMultiSelect
变量是一个 JS 变量,它引用您的 select 实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.