0

This is my code

var assert = require('assert');
var options = {
    desiredCapabilities: {
    browserName: 'chrome'
    }}

describe('It should navigate to beta- website on clicking publisher logo, ', function() {
    it('Go to thequint beta website', function () {
        browser.url('https://thequint-beta.quintype.io/');
        var windowHandle = browser.windowHandle();
        browser.windowHandleMaximize('{'+windowHandle.value+'}');
        var title = browser.getTitle();
        browser.pause(1000);


    });
    it('It should click any one story',function(){

        // browser.scroll("li[class='menu-list-item menu-icon']")
        browser.click("li[class='menu-list-item menu-icon']")
        //browser.leftClick("li[class='menu-list-item menu-icon']",1263,63);
        browser.pause(1000)
        // assert.browserisvisible('div#container > div > div:nth-of-type(2) > div > header > div:nth-of-type(2) > div:nth-of-type(2) > div:nth-of-type(2) > ul > li:nth-of-type(3) > div')
        console.log(url)
    })

});

The first it block is runnig well, but the second it block gives the following error

enter image description here

Please help.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Moin Ahmed
  • 49
  • 2
  • 8

1 Answers1

0

The error says that the element you are trying to click is inside an iframe. To click on elements in an iframe you have to switch the focus to the iframe.

The WebdriverIO documentation has all the info you should need

http://webdriver.io/api/protocol/frame.html