I want to do something like this:
$I->amOnPage('<URL>');
$I->executeJS('alert("yay!")'); // executeJS does not exist, I am looking for something like it
From what I googled, I can do it with WebDriver, but is it also possible with PhpBrowser?
No, it is impossible with PhpBrowser.