Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selenium code for ahref

 
Niks shah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am new to selenium.
please tell what will be selenium code for

<a href="javascript:showNewWindow('/market/preview.do?invid=118604&companyName=work.com')">

i tried for this
selenium.click( "//a[contains(@href, 'javascript:showNewWindow('/market/preview.do?invid=118604&companyName=work.com')')]");
but its throwing error
Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Invalid xpath

what is mistake is there in my code?
and
please suggest me some proper solution.


NIKS
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:

If the link is like this:

then you could try this:


John.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic