Attempting to run a javaScript command through the EventFiringWebDriver class in Selenium.
EventFiringWebDriver eventFiringWebDriver = new EventFiringWebDriver(driver);
eventFiringWebDriver.executeScript("document.querySelector('[ng-reflect-title='Assessment']>div.cc-tile>div.cc-tile-body').scrollTop=370");
Encountering an error: Runtime.evaluate threw exception: SyntaxError: missing ) after argument list
If I use the lengthy css selector provided by Chrome for this element:
body > bb-root > best-app > div > div.cc-content > bb-best > bb-assess > best-tile > div > div
instead of:
[ng-reflect-title='Assessment']>div.cc-tile>div.cc-tile-body
The code works without any issues. Both selectors return a single object when tested in Chrome Dev Tools. Using the more dynamic selector is preferred.