我想嘗試登錄這個(gè)網(wǎng)站這是我的代碼:driver.findElement(By.id("userid_sebenarnya")).sendKeys("myUserName");這是輸入文本的屬性 id='userid_sebenarnya'<div class="form-group" id="form-group-height"> <label for="userid" class="text-field-label-horizontal-empty">User ID</label> <input id="userid" class="fake_field_userid" style="-webkit-box-shadow: inset 0 0 0 2em transparent !important" value="autofill field" type="text"> <div class="outer-border-login"> <input class="form-control-login-transparent" id="userid_sebenarnya" placeholder="Masukkan user ID" onblur="removeErrMsg('#userid');" data-rule-required="true" data-msg-required="Field ini dibutuhkan" autocomplete="off" readonly="" onfocus="this.removeAttribute('readonly'); this.focus();" value="" autocorrect="off" autocapitalize="off" spellcheck="false" maxlength="2147483647" style="-webkit-box-shadow: inset 0 0 0 2em transparent !important" type="text"> </div></div>但是我收到了如下所示的錯(cuò)誤消息,而如果我從視覺上看應(yīng)該可以找到它。線程“main” org.openqa.selenium.NoSuchElementException 中的異常:沒有這樣的元素:無法定位元素:{“method”:“id”,“selector”:“userid_sebenarnya”}這與隱藏文本輸入有關(guān),我該怎么辦?
添加回答
舉報(bào)
0/150
提交
取消