2

I am using Selenium Webdriver tool for automation of my website.

I want to press ENTER key automatically using

driver.findElement(By.xpath('//*[@ng-click="today()"]')).sendKeys(Key.ENTER);

But I am getting error ReferenceError: Key is not defined

In python we have action chains to accomplish this task. Is there any alternative in Node js ?

1
  • The webdriver code looks to be in Java. There is no need to be asking for specifying node.js Commented Jun 21, 2017 at 9:07

1 Answer 1

1

Yes, Its working fine now.

driver.findElement((webdriver.By.xpath('//*[@ng-click="today()"]')).sendKeys(webdriver.Key.ENTER);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.