繁体   English   中英

使用 javascript 在 selenium webdriver 中发送密钥

[英]Send keys in selenium webdriver with javascript

在此处输入图片说明 我似乎无法使用 sendKeys 函数。 我正在使用 selenium webdriver 和 js 来发送密钥。 任何帮助,将不胜感激。

it("Apply text input", async function() {
await dashboardPage.run();

let inputs = await dashboardPage.componentsByClass('ace-content');
// identify the Element to put text into

for (let i in inputs){
  console.log(await results[i].sendKeys("https://www.google.com",Key.RETURN);    }
  await driver.sleep(4000);
});

删除console.log 发送密钥两次。

element.sendKeys("https://www.google.com")
element.sendKeys(driver.Key.ENTER)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM