1.背景:有些時候頁面上的元素不會直接顯示出來,通過接口返回的數(shù)據(jù)動態(tài)綁定。

2.頁面數(shù)據(jù)加載完畢后,在console里,可以獲取到該英文名的值

3.通過xpath也能獲取到該英文名的值

4.在代碼中使用selenium+js的方式獲取該值
element = puCom.element._find_element(TeacherClassManageObj.input_enName) //先找到該元素,其中,input_enName ="http://div[@id='bodyContainer']//input[@id='enName']"
act_enName = puCom.sLib._current_browser().execute_script("return arguments[0].value", element) //js獲取當前元素的value值