Share
Go down
rkrao
Posts : 1
Join date : 2013-06-16

How to simulate Ctrl+V in WebDriver2

on Sun Jun 16, 2013 9:23 pm
Hi,
I need to check the following scenario :
1. Click on an image link which copies the url of the current page to the clipboard
2. Do a ctrl + v in the address bar of a new browser window.

- Is it possible to achieve the 2nd point using webdriver2?
- Also is it possible to bring the focus to the address bar of the browser window to paste the copied url?
 Please help.
bauer_inc
Posts : 6
Join date : 2013-11-15

Re: How to simulate Ctrl+V in WebDriver2

on Fri Nov 15, 2013 4:43 pm
Hi,

I'm using the webdriver with java and this will work for me so:

1.  WebElement input = driver.findElement(By.xpath("//input"));
     input.sendKeys(Keys.CONTROL + "v");

2.  I think it is not possbile to locate the address bar as an WebElement.  
    Also pasting driver.get(Keys.CONTROL + "v"); was not working for me
    
Hope this helps

Alex
Back to top
Permissions in this forum:
You cannot reply to topics in this forum