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?

1
  • 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. Commented May 16, 2017 at 19:48

1 Answer 1

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

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.