I am having a problem sending the ENTER key using selenium. I've tried a variety of ways but it seems none of them are working.
Element code :
<span _ngcontent -c10>elementName</span>
After choosing the element, the element is changed to
<input _ngcontent -c10 class="title-input" type="text">
-I have made sure I have the right element.
-Whenever there's a "RETURN" I also tried using "ENTER".
Things I tried:
--1--
textBox.click();
textBox.sendKeys(Keys.RETURN);
--2--
Actions actions = new Actions(driver);
actions.click(textBox);
actions.sendKeys(textBox, Keys.RETURN);
--3--
driver.getKeyBoard().pressKey(Keys.RETURN);
Thread.sleep(100);
driver.getKeyBoard().releaseKey(Keys.RETURN);
--4--
Robot r = new Robot();
textBox.click();
r.keyPress(KeyEvent.VK_ENTER);
Thread.sleep(100);
r.keyRelease(KeyEvent.VK_ENTER);
Any help is appreciated! Thanks!
A bit more of outerHTML as DebanjanB requested :
<div _ngcontent-c6 class="tab clicked" style="width: 50%;">
<tab-header _ngcontent-c6 _nghost-c10>
<span _ngcontent-c10 class="tab-header-name">
<!---->
<input _ngcontent-c10 class="title-input" type="text"> == $0
<!---->
</span>
<!---->
<span _ngcontent -c10 id="delete-tab" class="can-delete">x</span>
<!---->
<!---->
<img _ngcontent-c10 id="not-pin-tab" src="assets/images/notPin.png">
<tab-header>
</div>