无法单击selenium中的链接文本元素

时间:2021-08-25 19:28:59

HTML:

  td class="tab"><a href="../accountopening/displayintroducer.jsp" target="mainFrame">Introducer</a> </td>

Tried with below locators

尝试使用以下定位器

linktext=Introducer, partialinktext 

xpath =("//a[href*='../accountopening/displayintroducer.jsp']");

3 个解决方案

#1


0  

Try this XPATH...

试试这个XPATH ......

//a[contains(@href,’../accountopening/displayintroducer.jsp’)]

#2


1  

Here is the Answer to your Question:

以下是您的问题的答案:

Try the following xpaths:

尝试以下xpath:

"//a[contains(text(),'Introducer')]"

OR

"//a[contains(@href,'accountopening/displayintroducer.jsp')]"

OR

"//a[contains(text(),'Introducer')][contains(@href,'accountopening/displayintroducer.jsp')]"

Let me know if this Answers your Question.

如果这回答你的问题,请告诉我。

#3


0  

You xpath appears wrong to me.

你xpath对我来说是错误的。

Try below xpath :-

尝试下面的xpath: -

//a[contains(.,'Introducer')]

OR

//a[@href='../accountopening/displayintroducer.jsp']

OR (More specific)

或者(更具体)

//a[contains(.,'Introducer') and @target='mainFrame']

Hope it will help you :)

希望它能帮到你:)

#1


0  

Try this XPATH...

试试这个XPATH ......

//a[contains(@href,’../accountopening/displayintroducer.jsp’)]

#2


1  

Here is the Answer to your Question:

以下是您的问题的答案:

Try the following xpaths:

尝试以下xpath:

"//a[contains(text(),'Introducer')]"

OR

"//a[contains(@href,'accountopening/displayintroducer.jsp')]"

OR

"//a[contains(text(),'Introducer')][contains(@href,'accountopening/displayintroducer.jsp')]"

Let me know if this Answers your Question.

如果这回答你的问题,请告诉我。

#3


0  

You xpath appears wrong to me.

你xpath对我来说是错误的。

Try below xpath :-

尝试下面的xpath: -

//a[contains(.,'Introducer')]

OR

//a[@href='../accountopening/displayintroducer.jsp']

OR (More specific)

或者(更具体)

//a[contains(.,'Introducer') and @target='mainFrame']

Hope it will help you :)

希望它能帮到你:)