samedi 3 juin 2017

Unable to locate element in nightwatch using its id

I am new to nightwatch.. I have encountered the following error while testing using nightwatch.

Expected element to be visible - element was not found - expected "visible" but got: "not found"

I have following two files:-

  1. page-object model(simpleLogin.js)
module.exports = {
         url: 'http://google.com',
        sections :{
                google: {
                 selector:'div#fkbx',
                  elements: {
                          searchBar :{
                                  selector : 'input[type=text]'
                          },
                          
                          searchButton :{
                                  selector : 'button[name=btnG]'
                          },
                  }
                }
        }
};
  1. the test js
module.exports = {
  'Test': function (client) {
    var homepage = client.page.simpleLogin();
        homepage.navigate()
        homepage.expect.section('@google').to.be.visible;
    var googleSection = homepage.section.google;
        client.end();
  }
};

Can anybody help me resolve this issue?

Aucun commentaire:

Enregistrer un commentaire