Display results as :

Rechercher Advanced Search


Open link in new tab using Chrome driver and C#?

View previous topic View next topic Go down

Open link in new tab using Chrome driver and C#?

Post by gardentools on Fri Feb 17, 2012 11:58 pm

Hi everyone,

I'm having a problem getting Selenium to act as though a link was clicked to open it up in a new tab, rather than in a new window which the link defaults to. I'm using the Chrome driver and C# in visual studio.

I know that in chrome normally if you hold down the control key and then click a link as normal with the left mouse button it will open in a new tab. However I seem to be failing to achieve this. So far I have the code:

driver = new ChromeDriver("C:/");
Actions testAction = new Actions(driver);

The logic being I build up a sequence where the left control button is pressed down, then the link is clicked, then the left control is released. This doesn't seem to work though - the link still opens in a new window. Does anyone have an idea why, or a better way to go about doing this?

Thanks in advance.


Posts : 1
Join date : 2012-02-17

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum