protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Read innerHTML of an element using Protractor for non-angular pages

Open sakshisingla opened this issue 12 years ago • 1 comments

Hi,

I want to read innerHTML of n element using Protractor for _non-angular_ pages. I have tried browser.driver.findElement(by.xpath("xpath")).getText()); browser.driver.findElement(by.xpath("xpath")).innerHTML;

However, both of them do not seem to work. They are giving the following output: { then: [Function: then], cancel: [Function: cancel], isPending: [Function: isPending] }

Thanks, Sakshi

sakshisingla avatar Sep 05 '14 04:09 sakshisingla

The result is a promise. Please take a look at the documentation to understand how to work with protractor promises: http://angular.github.io/protractor/#/control-flow

Closing as this is an answered question.

juliemr avatar Sep 05 '14 17:09 juliemr