通过javascriptExecutor执行脚本

时间:2015-11-18 12:47:23

标签: javascript java selenium webdriver

我想获得以下javascript执行以在java webdriver中执行。我正在使用SELECT CONCAT(fName, '', lName) AS 'Student Name' FROM Student WHERE studentId NOT IN (SELECT studentId FROM loan);

javascriptExecutor

当我执行它时,我得到以下异常
String script = "props();" + "function props(){" + "var b = document.querySelector("+ WE +");" + "var properties = [];" + "for(var k in b){" + "properties.push(k);" + "properties.sort();}" + "return properties;}"; JavascriptExecutor executor = (JavascriptExecutor)driver; executor.executeScript(script);

0 个答案:

没有答案