Is there a way to retrieve the value from the span tag using this code snippet?
var error = driver.findElement(webdriver.By.id('error-container-text')).getAttribute('innerHTML');
When I run the above code, I get a response that looks like this -
ManagedPromise {
flow_:
ControlFlow {
propagateUnhandledRejections_: true,
activeQueue_:
TaskQueue {
name_: 'TaskQueue::216',
flow_: [Circular],
tasks_: [Object],
interrupts_: null,
pending_: null,
subQ_: null,
state_: 'new',
unhandledRejections_: Set {} },
taskQueues_: Set { [Object] },
shutdownTask_: null,
hold_:
Timeout {
_called: false,
_idleTimeout: 2147483647,
_idlePrev: [Object],
_idleNext: [Object],
_idleStart: 22977,
_onTimeout: [Function],
_timerArgs: undefined,
_repeat: 2147483647 } },
stack_:
{ Task: WebElement.getAttribute(innerHTML)
at thenableWebDriverProxy.schedule (/home/app/node_modules/selenium-webdriver/lib/webdriver.js:816:17)
at WebElementPromise.schedule_ (/home/app/node_modules/selenium-webdriver/lib/webdriver.js:2024:25)
at WebElementPromise.getAttribute (/home/app/node_modules/selenium-webdriver/lib/webdriver.js:2276:17)
at Context.<anonymous> (/home/app/PycharmProjects/SampleTest/Sample.js:72:85)
at runTest (/home/app/node_modules/selenium-webdriver/testing/index.js:164:22)
at /home/app/node_modules/selenium-webdriver/testing/index.js:185:16
at new ManagedPromise (/home/app/node_modules/selenium-webdriver/lib/promise.js:1085:7)
at controlFlowExecute (/home/app/node_modules/selenium-webdriver/testing/index.js:184:14)
at TaskQueue.execute_ (/home/app/node_modules/selenium-webdriver/lib/promise.js:3092:14)
at TaskQueue.executeNext_ (/home/app/node_modules/selenium-webdriver/lib/promise.js:3075:27)
at asyncRun (/home/app/node_modules/selenium-webdriver/lib/promise.js:2982:25)
at /home/app/node_modules/selenium-webdriver/lib/promise.js:676:7 name: 'Task' },
parent_: null,
callbacks_: null,
state_: 'pending',
handled_: false,
value_: undefined,
queue_: null }