2015-03-08 99 views

回答

3

您可以通过使用executescript

((JavascriptExecutor) driver).executeScript("document.getElementById('locatorid').style.backgroundColor = 'lightblue';"); 

使用JavaScript,它设置有几个JavaScript函数,如果你需要通过类名或姓名

document.getElementsByName 
document.getElementsByClassName 

希望这可以帮助你找到它....如果你需要更准确的答案...请发布元素html源代码