testdevlab / TestUI

MIT License
33 stars 9 forks source link

Add .executeScript() function to execute JS scripts #91

Closed Kirils-Podgalskis closed 1 year ago

Kirils-Podgalskis commented 1 year ago

Current version of TestUI doesn't have its own .executeScript function. More over, following approach doesn't return any value at all:

((JavascriptExecutor) WebDriverRunner.getWebDriver()).executeScript(
    "2+2"
);
alvarolaserna commented 1 year ago

I don't think that has to return anything, to check that the executeScript works, you can try this:

((JavascriptExecutor) WebDriverRunner.getWebDriver()).executeScript("location.reload()");

This will reload the page, and it works

Kirils-Podgalskis commented 1 year ago

Yes, it works, but does not return anything

alvarolaserna commented 1 year ago

Im afraid this is direct implementation from Selenium, so if you are looking for it to return something, you will have to raise the issue on the Selenium repository. Unless you can prove me that this is happening only with this implementation.

alvarolaserna commented 1 year ago

Closing issue as it is not related to the repo, but Selenium itself