Ask a Question

how to get result from injected javascript

zelot
New Contributor

how to get result from injected javascript

Hello,

I would like to inject javascript to check document.readyState so I do this:

var readyState = page.contentDocument.Script.eval("return document.readyState;");

but readyState is null

when I do this:

var readyState = page.contentDocument.Script.eval("return 11;");

readyState is also null 😞

1 REPLY 1
AlexKaras
Community Hero

Re: how to get result from injected javascript

Hi,

 

a) readyState is directly accessible from script and Object Browser as Sys.Browser.Page.contentDocument.readyState;

b) https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/javascript.html might be helpful.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: