我想爲沒有名稱,無ID或無類的輸入字段提供值。如何從Web元素中提取XPATH或CSSPath java
<form class="formclass">
<input type="text">
<input type="password">
</form>`
我想爲沒有名稱,無ID或無類的輸入字段提供值。如何從Web元素中提取XPATH或CSSPath java
<form class="formclass">
<input type="text">
<input type="password">
</form>`
嘗試XPath
//form[@class="formclass"]/input[@type="text"]
//form[@class="formclass"]/input[@type="password"]
或CSS
選擇
form.formclass input[type="text"]
form.formclass input[type="password"]
目前的一些代碼,如果我們不知道的窗體類的名字嗎?我們如何才能得到元素的最近標識符(如id或name或class或xpath)到元素(沒有標識符的輸入字段)? – learner
爲了增加獲得幫助的機會,請包括貴 –