Within the script you need to use document to refer to the current document. The script fragment provided will be executed as the body of an anonymous function. JavascriptExecutor interface provides two methods as follows:ĮxecuteScript(): This method executes JavaScript in the context of the currently selected frame or window. You will find a detailed discussion in Uncaught DOMException: Blocked a frame with origin “ from accessing a cross-origin frame while listing the iframes in page This is particularly pertinent when creating your own XHR request or when trying to access another frame. While you execute your Selenium script at times because of cross domain policies browsers enforce your script execution may fail unexpectedly and without adequate error logging. JavascriptExecutor is the Selenium interface which is being implemented by all the following classes:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |