selenium - how to switch to frame that uses yui -
hi i'm trying switch iframes not know how switch frame, id uses yui forever dynamic, using selenium eclipse luna using google chrome webdriver browser
<iframe class="dialog-iframe-node " frameborder="0" id="yui_patched_v3_11_0_1_1436845377989_182_iframe_" name="yui_patched_v3_11_0_1_1436845377989_182_iframe_" src="https://mo-sit.nets.com.sg/group/main/pr-enquiry?p_p_id=p2p_procurement_enquiry_war_morp2pportlet&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_p2p_procurement_enquiry_war_morp2pportlet_action=rendergrnapplicationspopup&_p2p_procurement_enquiry_war_morp2pportlet_appno=pr020150102506&yui_patched_v3_11_0_1_1436845377989_183=1436845380806" style="height: 351px; width: 1024px;"></iframe>
whole html
<!doctype html> <html id="yui_patched_v3_11_0_1_1437015884634_696" class="aui ltr yui3-js-enabled gecko ltr js firefox firefox37 firefox37-0 win secure" lang="en-us" dir="ltr"> <div id="yui3-css-stamp" class="" style="position: absolute !important; visibility: hidden !important"></div> <head> <body id="yui_patched_v3_11_0_1_1437015884634_695" class="red yui3-skin-sam controls-visible guest-site signed-in private-page site"> <div class="yui3-widget-mask" style="position: fixed; width: 100%; height: 100%; top: 0px; left: 0px; z-index: 1202;"></div> <div id="yui_patched_v3_11_0_1_1437015884634_782" class="yui3-widget modal yui3-widget-positioned yui3-widget-modal yui3-widget-stacked modal-focused yui3-dd-draggable yui3-resize" style="height: 400px; width: 1024px; left: 397.5px; top: 5.89999px; z-index: 1202;" tabindex="0"> <div id="yui_patched_v3_11_0_1_1437015884634_795" class="modal-content yui3-widget-stdmod yui3-widget-content-expanded"> <div id="yui_patched_v3_11_0_1_1437015884634_1144" class="yui3-widget-hd modal-header"> <div id="yui_patched_v3_11_0_1_1437015884634_1005" class="yui3-widget-bd modal-body dialog-iframe-bd" style="max-height: 400px; height: 351px; padding: 0px;"> <iframe id="yui_patched_v3_11_0_1_1437015884634_782_iframe_" class="dialog-iframe-node " frameborder="0" src="https://mo-uat.nets.com.sg/group/main/pr-enquiry?p_p_id=p2p_procurement_enquiry_war_morp2pportlet&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_p2p_procurement_enquiry_war_morp2pportlet_action=rendergrnapplicationspopup&_p2p_procurement_enquiry_war_morp2pportlet_appno=pr020150706783&yui_patched_v3_11_0_1_1437015884634_783=1437016436400" name="yui_patched_v3_11_0_1_1437015884634_782_iframe_" style="height: 351px; width: 1024px;"> <!doctype html> <html class="aui ltr yui3-js-enabled gecko ltr js firefox firefox37 firefox37-0 win secure dialog-iframe-root-node" lang="en-us" dir="ltr" style="padding: 15px;"> </iframe> <div id="yui_patched_v3_11_0_1_1437015884634_951" class="loadingmask yui3-widget component overlay overlaymask yui3-widget-positioned yui3-widget-stacked overlaymask-hidden" style="position: absolute; left: 0px; top: 0px; height: 351px; width: 1024px; z-index: 1000;"> </div> </div> <div class="yui3-resize-handles-wrapper"> </div> <div id="yui_patched_v3_11_0_1_1437015884634_515" class="yui3-dd-shim" style="top: 0px; left: 0px; position: absolute; z-index: 9999; overflow: hidden; background-color: red; display: none; height: 5px; width: 5px;"></div> <div id="yui_patched_v3_11_0_1_1437015884634_222" class="yui3-widget modal yui3-widget-positioned yui3-widget-modal yui3-widget-stacked yui3-dd-draggable yui3-resize modal-hidden" style="height: 400px; width: 1024px; left: 2921px; top: 1107px; z-index: 1201;" tabindex="0"> <div id="yui_patched_v3_11_0_1_1437015884634_237" class="modal-content yui3-widget-stdmod yui3-widget-content-expanded"> <div id="yui_patched_v3_11_0_1_1437015884634_474" class="yui3-widget-hd modal-header"> <div id="yui_patched_v3_11_0_1_1437015884634_611" class="yui3-widget-bd modal-body dialog-iframe-bd" style="max-height: 400px; height: 351px; padding: 0px;"> <iframe id="yui_patched_v3_11_0_1_1437015884634_222_iframe_" class="dialog-iframe-node " frameborder="0" src="https://mo-uat.nets.com.sg/group/main/pr-enquiry?p_p_id=p2p_procurement_enquiry_war_morp2pportlet&p_p_lifecycle=0&p_p_state=pop_up&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_p2p_procurement_enquiry_war_morp2pportlet_action=rendergrnapplicationspopup&_p2p_procurement_enquiry_war_morp2pportlet_appno=pr020150706784&yui_patched_v3_11_0_1_1437015884634_223=1437015894284" name="yui_patched_v3_11_0_1_1437015884634_222_iframe_" style="height: 351px; width: 1024px;"> <div id="yui_patched_v3_11_0_1_1437015884634_420" class="loadingmask yui3-widget component overlay overlaymask yui3-widget-positioned yui3-widget-stacked overlaymask-hidden" style="position: absolute; left: 0px; top: 0px; height: 0px; width: 0px; z-index: 1000;"> </div> </div> <div class="yui3-resize-handles-wrapper"> </div> <a id="skip-to-content" href="#main-content">skip content</a> <div id="yui_patched_v3_11_0_1_1437015884634_729" class="wrapper"> </body> </html>
if there 1 frame on page can use following code (on python)
driver.switch_to.frame(driver.find_element_by_xpath("//iframe"))
in general case should find unique characteristic of frame, example, can child of element unique id etc
Comments
Post a Comment