使用后超出了最大调用堆栈大小:((JavascriptExecutor)seleniumdriver)。 executeScript(" return arguments [0] .attributes);",webElement);

时间:2015-08-27 12:56:49

标签: java selenium testing selenium-webdriver selenium-chromedriver

正如您所看到的here我正在使用

((JavascriptExecutor)seleniumdriver).
executeScript("return arguments[0].attributes);", webElement);

从webElement获取所有属性,但它给了我这个错误:

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Maximum call stack size exceeded
  (Session info: chrome=43.0.2357.134)
  (Driver info: chromedriver=2.17.340124 (8cdfc496335a58cfb8bdd672c7dce0c23456384b),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4.25 seconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 02:56:46'
System info: host: 'sina-PC', ip: '10.55.0.131', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.chrome.ChromeDriver

1 个答案:

答案 0 :(得分:-1)

看起来它错过了一个'('。

((JavascriptExecutor)seleniumdriver)
    .executeScript("return (arguments[0].attributes);", webElement);