Lokesh Reddy
Lokesh Reddy

Reputation: 85

How to emulate CTRL + A & CTRL + C in selenium IDE

I can't figure out how to do Ctrl + A to select all the text in a text box and Ctrl + C to copy it. I tried to do it using the following [see image] but it didnt' work.

enter image description here

Upvotes: 1

Views: 10333

Answers (1)

Sanjay Bhimani
Sanjay Bhimani

Reputation: 1603

Refer this link for your solution.

Here is firefox add-ons for advance on selenium IDE.

To integrate in java code for select whole page you need to do,

driver.findElement(By.xpath("//body")).sendKeys(Keys.chord(Keys.CONTROL, "a"));
driver.findElement(By.cssSelector("body")).sendKeys(Keys.chord(Keys.CONTROL, "a"));

For copy contents from element,

element.SendKeys(Keys.Control + "a");
element.SendKeys(Keys.Control + "c");

For past contents to element,

element.Clear();
element.SendKeys(Keys.Control + "v");

Upvotes: 0

Related Questions