0

I am working on automation using protractor for one of angular 2 application. I am able to get the option element what I want to select for a drop down.

Note: I have tried many different ways to get the option from DOM.

But I couldn't able to select it using click() method on WebElement. The click() is working in chrome but not in safari. Tried with browser.sleep(),ActionSequences,waitForAngular() etc.. But none has worked.

example code snippet:

     element(by.css('#country')).$('[value="1"]').click();

or

     element(by.css('#country')).filter(function (elem, index) {
        return elem.getText().then(function (text) {
        return text.indexOf('USA') !== -1;
     });}).first().click();

As I said earlier, I have used many ways to get the element what I want. But I am unable to select or click the option in safari browser.

Safari Version: 10.0.2 Mac Version: OS EI Captain 10.11.6

Irus
  • 81
  • 7
  • is it a plain dropdown ``, or a styled one? If it's the last then can you give a code example of the dropdown? – wswebcreation Apr 20 '17 at 04:27
  • Yes. It is a plain one. `` Like wise I have 230 countries listed in that select. – Irus Apr 20 '17 at 15:22
  • any idea on this? @wswebcreation. – Irus Apr 22 '17 at 04:05
  • Is the element actually found? Also you might try [`cssContainingText`](http://www.protractortest.org/#/api?view=ProtractorBy.prototype.cssContainingText). – Will Apr 25 '17 at 15:32
  • @Will, tried that too. I am able to get the element for sure. – Irus Apr 26 '17 at 17:11
  • @Will , Can you guys help me in providing a working example for safari drop down selection if you have any? – Irus Apr 26 '17 at 18:09

0 Answers0