Skip to content

Conversation

@cvakiitho
Copy link
Contributor

@philipphoberg
Copy link

Very useful, thanks!
Regarding the clear() function:
I noticed that some ui5 inputs are not effected by element.clear(). It seems to be some kind of Webdriver issue. (clear() will not take effect if the autocomplete attribute of the target element is 'off' or 'on')
Maybe my workaround is worth an addition to the cheatsheet.

let clear = element => {
  element.getAttribute('autocomplete').then(value => {
    if (value !== 'none') {
      element.getAttribute('value').then(value => {
        let backspace = protractor.Key.BACK_SPACE;
        element.sendKeys(backspace.repeat(value.length));
      });
    } else element.clear();
  });
}; 

@simplesoftlabs
Copy link

Hi Phillip, thanks for sharing this tip. I will try to work on the guide (remove some practices that I consider dangerous) and merge it very soon, and then I will merge this tip also.

@CLAassistant
Copy link

CLAassistant commented Aug 5, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants