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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Muhammad Aftab
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"

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/4b8c4614-0eac-4ad4-9c3e-2b236b112346%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

naveen-41

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.



On Tuesday, February 26, 2019 at 11:51:57 AM UTC+5:30, Muhammad Aftab wrote:
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 <a href="http://google.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://google.com&#39;;return true;" onclick="this.href=&#39;http://google.com&#39;;return true;">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"

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7f3275cc-6351-46fa-bfec-995bb2a4dc93o%40googlegroups.com.