Reputation: 85
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.
Upvotes: 1
Views: 10333
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