0

I'm using Selenium with Mink. I want to open a page in Safari and log in. For that I use

/**
 * @When /^(?:i|I) fill in "([^"]*)" with value "([^"]*)"$/
 */
public function iInputSomethingFormField($selector, $value)
{
    $page = $this->session->getPage();
    sleep(2);
    $elGoogleField = $page->find('css', $selector);

    $elGoogleField->setValue($value);

    sleep(2);
}

it works in Chrome, but in Safari, it does put the desired text in the field and adds a random sign apparently. In Selenium, it looks like this:

12:36:09.411 INFO - Done: [send keys: 0 [[SafariDriver: safari on MAC
(3D8210C2-66C8-48DC-9A74-639C9CDC8D8B)] -> 
xpath: //html/descendant-or-self::*[@id = 'usr']], [password]] 

And I have no idea where the char at the end comes from. Login fails of course because there is a wrong sign in the login data.

Any ideas?

yeaitsme
  • 91
  • 1
  • 9
  • Seems an issues with safari driver, have you tried to clear the field first? try to echo the value before filling it to see if you missed something. – lauda May 16 '17 at 19:48

1 Answers1

0

This was a bug in safaridriver, and is now fixed in Safari 11. The fix in WebKit is tracked here: https://bugs.webkit.org/show_bug.cgi?id=169733

Brian Burg
  • 795
  • 4
  • 10