Protractor : Failed: Object has no method 'getText'

95 views Asked by At

When I run the code below I get the error Protractor : Failed: Object has no method 'getText', and it was working with the older version of protractor 1.8. Everything was working fine and when I upgraded to latest version 2.1.0

it('Create Matter', function() {
              PlanPage.get().then(function() {
                PlanPage.ProjectsDashlet.createProject('Project workflow with external payments', 'DEBT_RECOVERY').then(function() {
                     PlanPage.ProjectPlannerDashlet.MatterDetailsDashlet.MatterDetailsTitle('A PVT Test','PVT Test Description');
                          browser.sleep(5000);
                              PlanPage.ProjectPlannerDashlet.matterTitle().getText().then(function(ele) {
                                  expect(ele.getText()).toBe('A PVT Test');
            });
          });
        });
       },60000);

    });


function matterTitle(){

   var ele = $('#dtMatterDetails-title');
    console.log(ele);
    Elements.waitForElementToBePresent(ele);
    return ele;
}
1

There are 1 answers

0
Devinder Singh On

I had to do this

function matterTitle(){

    return element(by.id('dtMatterDetails-title'));
}


 PlanPage.ProjectPlannerDashlet.matterTitle().getAttribute('value').then(function(ele) {