我期待文件添加到<input type="file">
有沒有什麼特別的文件類型輸入,使它無法找到?
下面是HTML
<span class="btn btn-xs btn-primary btn-file"> #found
<span class="blahicon blahicon-upload"></span>
Browse
<input type="file" data-bind="value: fileName, event: { change: uploadImagesOnChange }"
accept="blah/txt" multiple=""> #not found
</span>
的片段和這裏的水豚和紅寶石
within_frame('frame1') do
within_frame('frame2') do
within(:xpath, [containing span xpath]) do # finds this
find(:xpath, './/*[@type="file"]').send_keys('C:\Users\...\blah.txt') #ElementNotFound
end
end
end
我看不出有什麼隱藏的塊,它的超範圍。有什麼想法嗎?
我還應該添加find選擇器在螢火蟲 – TangibleDream
如果你在一個真實的瀏覽器中看,你可能會看到實際的文件輸入是隱藏或透明的 - 確切的錯誤是什麼? –
查看源代碼檢查嗎? ElementNotFound,明天我會發布 – TangibleDream