我的应用程序对话框有几个输入字段,我可以使用XPath在浏览器中找到这些输入字段,但是脚本给出了一个错误:
NO SUCH ELEMENT exception
<input name="ctl00$ctl39$g_1447640c_4de8_44db_9142_3f8ebf91a886$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" id="ctl00_ctl39_g_1447640c_4de8_44db_9142_3f8ebf91a886_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Maximum Attendees Required Field" class="ms-input" size="11" style="ime-mode:inactive;">
我正在使用的XPath:
//input[@id='ctl00_ctl39_g_1447640c_4de8_44db_9142_3f8ebf91a886_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField']
谢谢。
答案 0 :(得分:0)
尝试此操作将在页面上扫描该项目。
"//input[@type='text']"
分别在页面上有多个输入,您可以执行以下操作:
"//input[@type='text'][1]"
"(//input[@type='text'])[2]"