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