在硒中定位图像

时间:2015-07-23 10:16:41

标签: xpath selenium-webdriver

我想检查是否显示徽标(图像),但我无法找到相同的x路径.html代码如下:

 <div class="page-wrapper">
 <a class="brand pull-left" href="www.com">The Logo<\a>

可能是用于验证&#34;徽标&#34;的可能的xpath。显示。

1 个答案:

答案 0 :(得分:1)

可能其中一项有效:

//a[contains(text(), 'The Logo')]

//a[contains(text(), 'The Logo') and @href='www.com']

//div[@class='page-wrapper']/a[contains(text(), 'The Logo')]

//div[@class='page-wrapper']/a[contains(text(), 'The Logo') and @href='www.com']