-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key::TAB / postValue vs. Chrome 53 #243
Comments
|
Is this maybe related to: instaclick/php-webdriver#70 ? |
Facing the same issue here. Google Chrome 53.0.2785.92 ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1) Selenium server 2.53.1 |
Did anyone found or confirmed anything? |
Me nope. Probably somebody needs to post an issue on Chrome Driver issue tracker (with a link to it posted back here). |
ok, just for others to see, if I'm not mistaken, a workaround for $xpath = $this->getSession()->getSelectorsHandler()->selectorToXpath('named', [
'field',
$locator
]);
$elementName = strtolower($this->getSession()->getDriver()->getTagName($xpath));
if ($elementName === 'input' || $elementName === 'textarea') {
$element = $this->mink->getSession()->getDriver()->getWebDriverSession()->element('xpath', $xpath);
$existingValueLength = strlen($element->attribute('value'));
$value = str_repeat(Key::BACKSPACE.Key::DELETE, $existingValueLength).$value;
$element->postValue(['value' => [$value]]);
} else {
$this->findField($locator)->setValue($value);
} |
@fonsecas72 , you've just removed TAB if I'm reading this correctly. That is one of possible solutions, but then |
yup, users should be aware of the downside when using it. I'd suggest to move it to a special method or something :) @aik099 if you have a cleaner solution please let me know. |
for me, the workaround was to remove the Key::TAB from the end of the line in Selenium2Driver.php:662. About the "change" event, I don't know if is correct to fire this event automatically when an input is filled. I think could be more natural to have to explicitly hit the enter or leave the field to fire this event. |
That @stof , I know this might be a BC break, but maybe for inputs with free text entry (not checkbox/radio button/select) we can stop firing |
I think first we need to figure out if this is a BC break intended by chromedriver/chrome, or if it is actually a bug. |
How about this? doriancmore@e2710a2 |
I'm making the same as a workaround but I not sure if is there the correct place for calling to excuteScript. Probably is more natural to call the blur method after calling to setValue within the step definition. For example: In \Behat\Mink\Element\TraversableElement:fillField `
} |
The idea is to fix the issue without otherwise altering functionality. I wouldn't combine a bugfix with a change like that. |
It's true, you are right. |
@adorin , the @adridev , I've suggested an update to @adorin solution according to your suggestion. |
Same for me in Chrome Version 53.0.2785.101. It helped to delete Key::TAB in line 681
... as already said above. But untested in current Firefox. |
Also #194 seems to be identical. |
@lifeofguenter it seems that the TAB doesn't work only for password type inputs. For example, this worked for me:
I think is not a BC break to exclude only password type. |
@cocciagialla , did #244 work for you as well? A bonus side effect from #244 is ability to test jQueryUI.Autocomplete and similar controls. |
@aik099 yes it works perfectly. I hope it will be merged soon. |
Just merged #244. Happy test running. |
It seems that with recent Chrome (v53)
Key::TAB
as used in here: https://github.com/minkphp/MinkSelenium2Driver/blob/master/src/Selenium2Driver.php#L681 will actually cause the character\t
to be added into the input-box, instead of "hitting the tab key".I can not reproduce it on a normal workstation setup (e.g. real desktop), but it does not work on a headless chrome setup (Ubuntu 15.10 / selenium-server-standalone-2.53.1.jar):
Can be reproduced (headless-browser) with the following snippet:
selenium-server is started like this:
Swapping out the browser from chrome to firefox (version 46.0.1) works, as well as removing that
Key::TAB
from the code above (however not sure if it is the right fix, as obviously it should be working?).The text was updated successfully, but these errors were encountered: