Undefined class constant 'pageLoadStrategy' {"exception":"[object] error during execution with Selenium PHP and Laravel

i'm building web test code but i have error when first start
there seems to be something wrong at the beginning of code, but can't catche because don't know
-error
local.ERROR: Undefined class constant 'pageLoadStrategy' {"exception":"[object]
(Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Undefined class constant
'pageLoadStrategy' at /var/www/app/Service/SeleniumSet/Set.php:38)
-code
$host = env('SELENIUM_HOST'); // this is the default
$capabilities = DesiredCapabilities::chrome();
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
$capabilities->setCapability(ChromeOptions::pageLoadStrategy, 'nomal');
$this->driver = RemoteWebDriver::create($host, $capabilities, 7000);
$this->driver->executeScript("Object.defineProperty(navigator, 'plugins', {get: function() {return[1, 2, 3, 4, 5];},});");
return $this->driver;
Answer
Solution:
Instead ofnomal
the pageLoadStrategy
should have been normal
, effectively:
$capabilities->setCapability(ChromeOptions::pageLoadStrategy, 'normal');
References
You can find a couple of relevant discussions in:
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: method illuminate\database\eloquent\collection::paginate does not exist.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.