Question

I am a newbie Behat/php programmer. I am stuck with the following problem. I would appreciate any help...

I have a popup, where I need to read the link address from a textbox and open this link in a different tab.I have tried it in many ways,but I couldn't get it running.

Textbox on the page :

value="http://dev0.legacy-seosdraft......./service/seo_billing_process/index.php?pagetype=credit_form&invoice_id=...&email=.....;tld=en" name="invoiceUrl" class="invoice-url" readonly="readonly" type="text">

MinkContext.php :

/**
  * Displays the webmaster invoice form
  *
  * @Given /^I open the webmaster invoice form$/
  *
  */
public function iOpenWebmasterInvoiceForm()
{
    $page = $this->getMink()->getSession()->getPage();

    $invoiceURL = $page->getValue('xpath','//input[@name="invoiceUrl"]');
    $this->getSession()->visit($invoiceURL);
}

Thank you in advance for your help.

Cheers,

Was it helpful?

Solution

Fixed it with the following code ;

/**
 * Displays the webmaster invoice form
 *
 * @Given /^I open the webmaster invoice form$/
 *
 */
public function iOpenWebmasterInvoiceForm()
{
   $page = $this->getMink()->getSession()->getPage();

   $invoiceURL = $page->find('xpath','//input[@name="invoiceUrl"]')->getValue();

   $this->getSession()->visit($invoiceURL);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top