Undefined property: stdClass::$ELEMENT in C:\xampp\htdocs\selenium-test\phpwebdriver\WebElement.php

48 views
Skip to first unread message

Muhammad Aftab

unread,
Feb 26, 2019, 1:21:57 AM2/26/19
to Selenium Users
Hello I am selenium new user. I have setup my all setting. When i run example.php project, It run fine and open firefox and also open google.com after that firefox closed but not search given keyword.
and project produce error "Notice: Undefined property: stdClass::$ELEMENT in C:\xampp\htdocs\selenium-test\phpwebdriver\WebElement.php on line 28"

naveen kumar

unread,
Jun 30, 2020, 2:45:58 AM6/30/20
to Selenium Users

Solution:- 

I have the same problem but I solve this error by debugging the code.

Go to the inside phpwebdriver folder and find the file webElement.php. In-line number 28 you will get the code:-

parent::__construct($root . "/element/" . $element->ELEMENT);

Replace this line to:-

foreach ($element as $ele){
parent::__construct($root . "/element/" . $ele);
    }

And run the run your test file again. The error will get solved.

Reply all
Reply to author
Forward
0 new messages