I have SPA application in which wanted to scroll down and click on the specific button
Wait Until Keyword Succeeds 30 sec 5 sec SeleniumLibrary.Scroll Element Into View ${Edit_Btn}
Wait Until Keyword Succeeds 30 sec 5 sec SeleniumLibrary.Click Element ${Edit_Btn}
Also, tried Execute Javascript
Execute Javascript document.getElementById("editBtn").click()
But it did not work and getting error
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' System info: host: 'SAUCE-WIN10', ip: '10.119.22.184', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131' Driver info: driver.version: RemoteWebDriver Stacktrace:
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:220)
at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode (AbstractHttpCommandCodec.java:118)
at org.openqa.selenium.remote.HttpCommandExecutor.execute (HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute (DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteExecuteMethod.execute (RemoteExecuteMethod.java:35)
at org.openqa.selenium.remote.RemoteMouse.mouseMove (RemoteMouse.java:89)
at org.openqa.selenium.support.events.internal.EventFiringMouse.mouseMove (EventFiringMouse.java:58)
at org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call (MouseMoveToLocation.java:59)
at org.openqa.selenium.remote.server.handler.interactions.MouseMoveToLocation.call (MouseMoveToLocation.java:32)
at java.util.concurrent.FutureTask.run (None:-1)
at org.openqa.selenium.remote.server.DefaultSession$1.run (DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker (None:-1)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (None:-1)
at java.lang.Thread.run (None:-1)
Using firefox version: 98 OS: Windows 10
Kindly suggest
CodePudding user response:
The JDK version is old and ancient:
java.version: '1.8.0_131'
Solution
Ensure that:
- JDK is upgraded to current levels JDK 8u311.
- Selenium is upgraded to latest released version.
CodePudding user response:
Check this answer and try once, it will work. It has custom keyword, just pass your locator as argument.