简体   繁体   English

如何使用Selenium Webdriver 2.25-Java单击ahref链接?

[英]How to click on the ahref link using selenium webdriver 2.25 - java?

I am unable to click on the Opportunity link Action| 我无法单击“机会”链接。 Opportunity Name | 商机名称| Account Name | 帐户名| Stage | 舞台 Close Date | 截止日期| Opportunity Owner 机会所有者

<th scope="row" class=" dataCell ">
  <a href="/006b00000029ay9?srPos=0&amp;srKp=006" data-seclke="Opportunity" data-seclkh="bf4b3627c01dbc9e32ca3a945ddbe3ec" data-seclki="006b00000029ay9" data-seclkp="/006b00000029ay9" data-seclkr="1" onclick="searchResultClick.click(this)" onmousedown="searchResultClick.click(this)">Test Opp1</a>

I have added (-) hyphen in front of the tags to paste the HTML exact code what I am getting. 我在标签前面添加了(-)连字符,以粘贴HTML确切的代码。 I need to click on the ahref. 我需要单击ahref。 Kindly advise me what should I use? 请告知我应该使用什么?

driver.findElement(By.linkText("Test Opp1")).click();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何<a class </a>在Selenium WebDriver中使用Java</a>单击带有标签名称的链接 - How to click a link with Tag name <a class </a> using Java in Selenium WebDriver 如何使用Selenium WebDriver(Java)单击图像/链接 - How to click on an image/link using Selenium WebDriver (Java) 如何使用Java中的Selenium WebDriver单击列表中的链接 - How to click the link located in a list using Selenium WebDriver in Java 使用带有Java的Selenium WebDriver无法单击鼠标悬停链接 - Unable to click a mouse hover link using Selenium WebDriver with Java 无法使用Selenium Webdriver(Java)单击“确认电子邮件”链接 - Not able to click on “Confirm Email” link using selenium webdriver (Java) 在Java w / Selenium WebDriver中,如何仅在广告展示时如何使用JavaScript单击覆盖广告上的链接? - In Java w/Selenium WebDriver, how to I click link on overlay ad using JavaScript only when ad shows? 如何使用 Selenium Webdriver 和 Java 在框架内单击 iframe 内的链接 - How to click on a link inside an iframe which is inside a frame using Selenium Webdriver and Java 如何用Selenium Webdriver和Java点击 - How to click with Selenium Webdriver and Java 如何使用Java Selenium单击AngularJS链接? - How to click on an AngularJS link using Java Selenium? 如何使用Java使用Selenium Webdriver单击此注销图标 - How to click this Logout Icon using Selenium Webdriver using Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM