Closed chandon closed 4 years ago
Hello,
With Java, i can call a JS script with an Element as parameter. Example (with Firefox or Chrome) :
WebElement element=driver.findElement(By.cssSelector("#myElement")); ((JavascriptExecutor) driver).executeScript("elem=arguments[0];console.log(elem);", element);
=> in the browser context, "elem" contains the node corresponding to "element" in java
With phpunit-selenium, I tried :
$element=$this->byCssSelector("#myElement"); $this->execute( array( 'script'=>"elem=arguments[0];console.log(elem);", 'args'=>array($element), ) );
=> in the browser context, "elem" contains an empty Object...
How to do that with phpunit-selenium ? Thanks
Hi @chandon
This package doesn't have this feature. You can still JS selector
$this->execute([ 'script'=>"elem = document.getElementById('myElement');console.log(elem);", 'args'=>[], ]);
Hello,
With Java, i can call a JS script with an Element as parameter. Example (with Firefox or Chrome) :
=> in the browser context, "elem" contains the node corresponding to "element" in java
With phpunit-selenium, I tried :
=> in the browser context, "elem" contains an empty Object...
How to do that with phpunit-selenium ? Thanks