0

I am using facebook php-webdriver for my web app testing. There is a function in webdriver that works as below

$webdriver->wait($timeOut, $pollInterval)->until(
    //condition to wait
); 

This "condition to wait" is passed as a method such as;

$val = WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user"))

So the full code block is like;

$webdriver->wait($timeOut, $pollInterval)->until(
    $val = WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user"))
); 

I then have anther method such as;

function get($url, [few more params], $expectedCondition){
    //do some work here and execute below wait condition
    $webdriver->wait($timeOut, $pollInterval)->until(
        $expectedCondition //this executes fine
    ); 
}

I will call the above method as below; get ([other params], WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user"))

As you see the last parameter above is a method call in itself that comes into my GET method. It'll execute properly as below

    $webdriver->wait($timeOut, $pollInterval)->until(
        $expectedCondition //this will basically executes WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::id("user")) properly
    );  

However I can't get the return value after executing $expectedCondition.

eval() doesn't work

1 Answer 1

0
$return_value = $driver->wait()->until($expectedCondition)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.