记录一些需要记忆的查找元素的内容: 1. driver.findElement(By.name("DELETE"); //We can use the DELETE text to locate the DELETE button as Name. 2. driver. findElementByAccessibilityId("plus"); //We can use content-desc as AccId to perform an action on
一.背景:一个表单中,要修改一些li中有class=box的样式,将它的background设置为red红色.一般的做法是我们可以先找到父级元素 ,然后由父级元素找到所有相关tagName,最后,来一个if判断,如果class属性为box,则修改之 var oUl = document.getElementById("ul1"); //加上它的上级元素,可以避免我们筛选出许多无用的节点出来 var aLi = oUl.g