0

I am trying to get the text value from an element and I tried lots of variation. nothing worked.. this is my latest attempt:

    $totalFlightPrice = $row->elements($row->using('css selector')->value('span[class="totalPriceToBook"]'));
    echo 'counted: '.count($totalFlightPrice)."\n";
    foreach ($totalFlightPrice as $tp) {
        echo 'text: '.$tp->text()."\n";
    }

when I'm using var_dump on totalFlightPrice I am receving the Object, which means its able to find the div. but when im using the text function nothing is returned.

this is my span element:

<span class="totalPriceToBook">382€</span>

1 Answer 1

1

Try using getText() method http://docs.tadiavo.com/phpunit/www.phpunit.de/pocket_guide/3.1/en/selenium.html takes xpath of an element as a parameter.

$this->getText("xpath=//div/span[@class='totalFlightPrice");
Sign up to request clarification or add additional context in comments.

Comments

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.