How to solve the link has target ‘_blank’, which is not supported in Selenium 

Here is an example  <a id=”ctl00_contentSection_ViewSeleniumWiki” target=”_blank” href=”http://www.seleniumwiki.com”>View Selenium Wiki</a>
If you use selenium IDE to click on the link you will get the error message : Link has target ‘_blank’, which is not supported in Selenium! Randomizing target to be:

Here is the solution

<tr>
<td>storeAttribute</td>
<td>//a[@id='ctl00_contentSection_ViewSeleniumWiki']/@href</td>
<td>href</td>
</tr>
<tr>
<td>echo</td> ' this is only optional
<td>${href}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${href}</td>
<td></td>
</tr>

Submitted by Pavandeep Puddupakkam

How did this solution work for you? Do you have a better alternative? Feel free to share your thoughts in comments section below.


Google Webdriver Forum -The Online Community for Google Webdriver and Selenium RC Users and Professionals
2 responses to “How to solve the link has target ‘_blank’, which is not supported in Selenium”
  1. Bill Gates says:

    I am looking to extend the above solution, I want to be able to set the focus on the window/tab opened by clicking on a link with a target=”_blank” attribute.

    Do you know how i could achieve this in C#?

    Thanks.

  2. ankit says:

    [warn] Link has target ‘_blank’, which is not supported in Selenium! Randomizing target to be: selenium_blank58586 …….i got his error please help me to resolve .

Leave a Reply