0

I have a protractor script running on desktop (chrome,firefox,safari) and iPhone(safari). Its working fine everywhere except iPhone safari. If we run the script, it will click on a link which will open a page on new tab. But it looks like the click() event does not happen. I can tell by looking at the iPhone browser while script is running. The script is as following.

it('click on about room5',function () {
        browser.driver.findElement(By.css("a[href='/about']")).click();
        browser.driver.sleep(10000);

        browser.getAllWindowHandles().then(function(handles) {
            browser.switchTo().window(handles[1]);
            browser.driver.sleep(sleep);
            browser.driver.getCurrentUrl().then(function(url){
                expect(url).toBe(baseUrl + "about/");
            });
            browser.close();
            browser.switchTo().window(handles[0]);
        });
    });

The error I am getting as following:

Message:
    Failed: Parameters were incorrect. We wanted {"required":["name"]} and you sent []

I guess I am having this because there is no other window only the current window. Because the click() event did not occur. I am not sure why is this happening. Its even working fine on android chrome as well.

Any idea?

Thanks

  • 2
    Possible duplicate of [Click() function isn't working in protractor scripts](http://stackoverflow.com/questions/36871071/click-function-isnt-working-in-protractor-scripts) – Andersson Apr 19 '17 at 14:22
  • No I followed the solution there, but its not working. click() function works everywhere else, but clicking on something which is opening in new tab not working. – Md. Samsul Kabir Apr 24 '17 at 15:07

0 Answers0