0
我是新来的硒ide,我想自动化一些网站。我希望它是这样的。点击Selenium IDE中的多个链接
点击
Click Link 1
do some clicking inside that link
go back to the list of link
Click Link 2
do some clicking inside that link
go back to the list of link
Click Link 3
and so on
我这里唯一的问题是我不知道它将如何单击从顶部的第一个环节。这是网站的html。
<h5>20 seconds ago</h5>
<ul>
<li class="notification-posted">
<img height="15" alt="" src="/assets/images/icons/notification-posted.png">
<a href="/account/54351-wews">wews</a>
send new
<a href="/news/53235">post</a> **Link 1**
</li>
</ul>
<h5>3 minutes ago</h5>
<ul>
<li class="notification-posted">
<img height="15" alt="" src="/assets/images/icons/notification-posted.png">
<a href="/account/632323-yokol">yokol</a>
submitted a new
<a href="/news/253129-loss">post</a> **Link 2**
</li>
</ul>
<h5>4 minutes ago</h5>
<ul>
<h3>6 minutes ago</h3>
<ul>
<h5>7 minutes ago</h5>
<ul>
<h2>8 minutes ago</h2>
<ul>
<li class="notification-posted">
<li class="notification-posted">
<li class="notification-posted">
<li class="notification-posted">
<li class="notification-posted">
<img height="15" alt="" src="/assets/images/icons/notification-posted.png">
<a href="/account/153316-problem">hey</a>
send new
<a href="/news/25151-helloworld">post</a> **link 3**
</li>
</ul>
谢谢你的回答,那是webdriver的权利吗?我的问题是:( – Junosaur
如果你必须使用xpath的硒ide,你可以不指定像“// a [1]”或“//a [2]”锚?像数组一样,它会发现第n次出现该元素,在你的情况下,它是一个锚点 –
,如果链接处于相同的/ ul,那么xpath将会是这样的情况下将起作用 // div [@ id ='main']/ul [1]/li [1] [@ class ='notification-posted']/a [2] // div [@ id ='main']/ul [1]/li [2] [@ class ='notification-posted']/a [2] 它不能点击其他/ ul中的链接,就像这个链接 // div [@ id ='main']/ul [2]/li [@ class ='notification-posted']/a [2] 无论如何,如果这是不可能在硒ide,也许我会只使用硒webdrive r我只是不知道从哪里开始LOL非常感谢你,他非常喜欢chola他喜欢哦 – Junosaur