phpunit-selenium icon indicating copy to clipboard operation
phpunit-selenium copied to clipboard

elementFromResponseValue doesn't work now

Open dobryy opened this issue 12 years ago • 0 comments

There was a test but in the latest version it was deleted

public function testElementFromResponseValue()
    {
        $this->url('html/test_open.html');
        $elementArray = $this->execute(array(
            'script' => 'return document.body;',
            'args' => array(),
        ));
        $element = $this->elementFromResponseValue($elementArray);
        $this->assertEquals('This is a test of the open command.', $element->text());
    }

I am using JavaScript object property that contains dom element to get elements

    $dom = $this->execute
        (
            array(
                "script" => "return AddNewUsersBtn.dom;",
                'args'   => array()
            )
        );

        return $this->elementFromResponseValue($dom);

After latest updates it doesn't work.

I've tried to use

return PHPUnit_Extensions_Selenium2TestCase_Element::fromResponseValue($dom, $this->getSessionUrl()->descend('element'), ???);

but I can't figure out where can I get driver instance for the third parameter.

How can I get driver instance? Or is there another way to get elements using dom element?

dobryy avatar May 15 '13 12:05 dobryy