I am trying to select an iFrame which has a text box within it. Here is the structure of the page:
<html>
<body>
<many text fields>
<iframe>
#document
<html>
<body>
<p>
WRITE TEXT HERE;
</p>
</body>
</html>
</iframe>
<more tags to do other things>
</body>
</html>
And here is my function to access and write text in the
tags within the tags:
// Select iFrame
/**
*
*
* @Given /^I switch to iframe "([^"]*)"$/
*/
public function iSwitchToIframe($field1)
{
$field1 = $this->fixStepArgument($field1);
$page = $this->getSession()->getPage();
$el = $page->find('css', $field1);
$this->fillField($el, 'This is field value');
}
I am not sure what am I doing wrong here. I keep getting 'Object of class NodeElement could not be converted to a string' error.