selenium webdriver - webdriverio Set getText string to variable -
i'm trying instantiate variable contents of gettext method using webdriverio.
  = string(browser.gettext('.field_notice'));   when attempt print variable output:
[object object]
thanks help!
browser.gettext() asynchronous call need provide callback instantiate variable. try : 
browser     .gettext('.field_notice').then(function(text) {         = text;     });   a similar example can found on webdriverio developer guide : http://webdriver.io/guide.html
also, there no need convert variable string since method returns string. see https://github.com/webdriverio/webdriverio/blob/master/lib/commands/gettext.js
Comments
Post a Comment