0
我無法在iPhone 5s和6S +中進行鼠標和鍵盤操作。由於網站包含iFrames。如何處理iOS(移動設備)中的iframe?如何使用iOS webdriver處理iframe,我正在使用iPhone 5s&6S +?請在此幫助我
在此先感謝
我無法在iPhone 5s和6S +中進行鼠標和鍵盤操作。由於網站包含iFrames。如何處理iOS(移動設備)中的iframe?如何使用iOS webdriver處理iframe,我正在使用iPhone 5s&6S +?請在此幫助我
在此先感謝
如果iFrame中都存在,你需要得到他們的內部文件做鼠標和鍵盤操作。對於UIWebView或WKWebView,這意味着將2行添加到腳本的開頭以插入到網頁中。例如:
NSString *[email protected]"var iFrame=document.getElementById('idOfFrame'); \
var innerDoc=iFrame.innerDocument || iFrame.contentWindow.document; \
//Now do other things w/ innerDoc instead of document
";
現在,您將插入您的腳本。
[self.webView stringByEvaluatingJavaScriptFromString:scriptToInsert];
謝謝伊恩,我會檢查你的代碼... –