WebDriver通过xpath查找//input [@ value ='empty'] [英] WebDriver find by xpath where //input[@value='empty']

查看:391
本文介绍了WebDriver通过xpath查找//input [@ value ='empty']的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过xpath查找一个具有空"值的输入元素.

I need to find an input element with an 'empty' value by xpath.

类似于//input[@value='empty']的东西.我不是说空"一词,而是空值或空值.

Something like //input[@value='empty']. I don't mean the word 'empty', but the value is empty or blank.

什么Xpath将返回此类元素?

What Xpath will return such element?

谢谢

推荐答案

由于我在评论中发布的链接是一种可能的解决方案 因此,我想将其发布为答案:

Since the link I posted in the comment is a potential solution So, I thought to post it as an answer:

如何在XPath中选择一个空元素?

根据评论的建议,重复链接的答案的基本部分(以防链接过时),请在下面找到它:

Based on advice from the comment to duplicate the essential parts of the linked answer (incase the link becomes obsolete), please find it below:

您可以使用XPath的not()函数.

You could use XPath's not() function.

   a[@href='#'][@class='button save-as'][@title='SaveAs...'][not(text())]

这篇关于WebDriver通过xpath查找//input [@ value ='empty']的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆