diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee b/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee new file mode 100644 index 00000000..1838fa27 --- /dev/null +++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee @@ -0,0 +1,66 @@ +pageTitle = (page) -> + page.evaluate -> + window.document.title +setPageTitle = (page, newTitle) -> + page.evaluate ((newTitle) -> + window.document.title = newTitle + ), newTitle +p = require("webpage").create() +p.open "../test/webpage-spec-frames/index.html", (status) -> + console.log "pageTitle(): " + pageTitle(p) + console.log "currentFrameName(): " + p.currentFrameName() + console.log "childFramesCount(): " + p.childFramesCount() + console.log "childFramesName(): " + p.childFramesName() + console.log "setPageTitle(CURRENT TITLE+'-visited')" + setPageTitle p, pageTitle(p) + "-visited" + console.log "" + console.log "p.switchToChildFrame(\"frame1\"): " + p.switchToChildFrame("frame1") + console.log "pageTitle(): " + pageTitle(p) + console.log "currentFrameName(): " + p.currentFrameName() + console.log "childFramesCount(): " + p.childFramesCount() + console.log "childFramesName(): " + p.childFramesName() + console.log "setPageTitle(CURRENT TITLE+'-visited')" + setPageTitle p, pageTitle(p) + "-visited" + console.log "" + console.log "p.switchToChildFrame(\"frame1-2\"): " + p.switchToChildFrame("frame1-2") + console.log "pageTitle(): " + pageTitle(p) + console.log "currentFrameName(): " + p.currentFrameName() + console.log "childFramesCount(): " + p.childFramesCount() + console.log "childFramesName(): " + p.childFramesName() + console.log "setPageTitle(CURRENT TITLE+'-visited')" + setPageTitle p, pageTitle(p) + "-visited" + console.log "" + console.log "p.switchToParentFrame(): " + p.switchToParentFrame() + console.log "pageTitle(): " + pageTitle(p) + console.log "currentFrameName(): " + p.currentFrameName() + console.log "childFramesCount(): " + p.childFramesCount() + console.log "childFramesName(): " + p.childFramesName() + console.log "setPageTitle(CURRENT TITLE+'-visited')" + setPageTitle p, pageTitle(p) + "-visited" + console.log "" + console.log "p.switchToChildFrame(0): " + p.switchToChildFrame(0) + console.log "pageTitle(): " + pageTitle(p) + console.log "currentFrameName(): " + p.currentFrameName() + console.log "childFramesCount(): " + p.childFramesCount() + console.log "childFramesName(): " + p.childFramesName() + console.log "setPageTitle(CURRENT TITLE+'-visited')" + setPageTitle p, pageTitle(p) + "-visited" + console.log "" + console.log "p.switchToMainFrame()" + p.switchToMainFrame() + console.log "pageTitle(): " + pageTitle(p) + console.log "currentFrameName(): " + p.currentFrameName() + console.log "childFramesCount(): " + p.childFramesCount() + console.log "childFramesName(): " + p.childFramesName() + console.log "setPageTitle(CURRENT TITLE+'-visited')" + setPageTitle p, pageTitle(p) + "-visited" + console.log "" + console.log "p.switchToChildFrame(\"frame2\"): " + p.switchToChildFrame("frame2") + console.log "pageTitle(): " + pageTitle(p) + console.log "currentFrameName(): " + p.currentFrameName() + console.log "childFramesCount(): " + p.childFramesCount() + console.log "childFramesName(): " + p.childFramesName() + console.log "setPageTitle(CURRENT TITLE+'-visited')" + setPageTitle p, pageTitle(p) + "-visited" + console.log "" + phantom.exit() |