-1

enter image description hereI can't seem to get the sendKeys function to work. I am using selenium webdriver, and js to send keys. any help would be appreciated.

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);
});
Mega_maha
  • 17
  • 4

1 Answers1

0

Remove console.log. Send Keys two times.

element.sendKeys("https://www.google.com")
element.sendKeys(driver.Key.ENTER)
mahan
  • 12,366
  • 5
  • 48
  • 83
  • `var applyLinks = await dashboardPage.componentsByCssSelector(".MuiInputBase-input"); applyLinks[0].click(); applyLinks[0].sendKeys("red");` I can get this to input red but not press enter. What do you think? I tried (red.ENTER) – Mega_maha Apr 17 '20 at 16:03
  • thanks so much! I kept doing (driver.Keys.Enter) and I didnt specify key at the top to require selenium webdriver. – Mega_maha Apr 23 '20 at 13:51