Skip to content

waitForElementUntilIsPresent doesn't work with By::linkText #25

@machek

Description

@machek

By::linkText seems to me doesn't work with waitForElementUntilIsPresent

Here is small example:

        $this->_driver->get("https://www.google.com/");
        $this->_driver->findElement(By::id("gbqfq"))->setValue("phpunit");
        $manualLink =  $this->_driver->waitForElementUntilIsPresent(By::linkText("PHPUnit Manual"));
        $manualLink->click();

I get SeleniumClient\Http\SeleniumUnknownErrorException : An unknown server-side error occurred while processing the command.
And on SeleniumServer

15:31:40.100 INFO - Executing: [click: null] at URL: /session/1d45438b-a2f5-4d73-bb64-a4070cf6a1b7/element//c
lick)
15:31:40.101 WARN - Exception thrown
java.lang.NullPointerException
at org.openqa.selenium.remote.server.handler.ClickElement.call(ClickElement.java:29)
at org.openqa.selenium.remote.server.handler.ClickElement.call(ClickElement.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

When I debug the code and give page time to load then it works. I see problem at WebDriver.php line 65 where $resultObject is returned (SeleniumClient\WebElement) but _elementId is NULL. When link is found _elementId is 1.

Is it bug or I should do it differently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions