久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='6UBAG'></small><noframes id='6UBAG'>

<legend id='6UBAG'><style id='6UBAG'><dir id='6UBAG'><q id='6UBAG'></q></dir></style></legend>
      • <bdo id='6UBAG'></bdo><ul id='6UBAG'></ul>

        <tfoot id='6UBAG'></tfoot>
        <i id='6UBAG'><tr id='6UBAG'><dt id='6UBAG'><q id='6UBAG'><span id='6UBAG'><b id='6UBAG'><form id='6UBAG'><ins id='6UBAG'></ins><ul id='6UBAG'></ul><sub id='6UBAG'></sub></form><legend id='6UBAG'></legend><bdo id='6UBAG'><pre id='6UBAG'><center id='6UBAG'></center></pre></bdo></b><th id='6UBAG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6UBAG'><tfoot id='6UBAG'></tfoot><dl id='6UBAG'><fieldset id='6UBAG'></fieldset></dl></div>

      1. iframe下處理#document的方法

        Ways to deal with #document under iframe(iframe下處理#document的方法)

          • <small id='EFeh7'></small><noframes id='EFeh7'>

              • <bdo id='EFeh7'></bdo><ul id='EFeh7'></ul>
                  <tbody id='EFeh7'></tbody>
                <legend id='EFeh7'><style id='EFeh7'><dir id='EFeh7'><q id='EFeh7'></q></dir></style></legend>

                  <tfoot id='EFeh7'></tfoot>
                  <i id='EFeh7'><tr id='EFeh7'><dt id='EFeh7'><q id='EFeh7'><span id='EFeh7'><b id='EFeh7'><form id='EFeh7'><ins id='EFeh7'></ins><ul id='EFeh7'></ul><sub id='EFeh7'></sub></form><legend id='EFeh7'></legend><bdo id='EFeh7'><pre id='EFeh7'><center id='EFeh7'></center></pre></bdo></b><th id='EFeh7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EFeh7'><tfoot id='EFeh7'></tfoot><dl id='EFeh7'><fieldset id='EFeh7'></fieldset></dl></div>

                  本文介紹了iframe下處理#document的方法的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  對于我現在正在測試的門戶,我遇到了無法創建任何 xpath 定位器的問題,一段時間后我發現這是因為#document",這切斷了路徑并使簡單復制 xpath"將路徑指向完全不同的元素.

                  For the portal I am testing now, I came with the problem that I could not create any xpath locators, after some time I figured out that it was because of an '#document', this cuts the path and makes the simple "copy xpath" to direct the path to a completely different element.

                  <iframe id="FRAMENAME" src="/webclient/workspace/launch-task/REMbl?ds=BP" width="100%" height="100%" frameborder="0" data-navitemname="navitemname" style="" xpath="1">
                  #document
                      <html>
                          CODE....
                      </html>
                  

                  我找到了解決方案,只需像這樣添加一個 switchTo:

                  I found the solution for this is it is simply add a switchTo like this:

                  driver.switchTo().frame("FRAMENAME");
                  

                  這可以使其余代碼正常工作,但是需要一些額外的時間來處理此命令,直到代碼移至下一行.

                  This works and makes the rest of the code to work properly but, takes some extra time processing this command till the code moves to the next line.

                  所以我想問一下,有沒有更好的解決方案?更智能/更快的東西?

                  So I would like to ask, is there is a better solution for this? something smarter/faster?

                  我擔心當我有很多腳本的時候,執行時間會太長.

                  I am concerned that when the point where I have lots of scripts comes, the execution time will take too long.

                  例如,我不使用 id 定位器,因為它們都是動態的,所以有時需要 xpath.

                  I don't use id locators for example because they are all dynamic so sometimes a xpath is required.

                  謝謝!

                  推薦答案

                  內嵌框架

                  根據使用內聯框架中的文檔,內聯框架是一種嵌入將文檔轉換為 HTML 文檔,以便 嵌入的數據顯示在瀏覽器窗口的子窗口中.這并不意味著完全包含并且兩個文檔是獨立的,它們都被視為完整的文檔,而不是將一個文檔視為另一個文檔的一部分.

                  inline frames

                  As per the documentation in Using inline frames, an inline frame is a construct which embeds a document into an HTML document so that embedded data is displayed inside a subwindow of the browser's window. This does not mean full inclusion and the two documents are independent, and both them are treated as complete documents, instead of treating one as part of the other.

                  • 一般來說,一個 iframe 元素的形式是:

                  • Generally, an iframe element is in the form of:

                  <iframe src="URL" more attributes>
                  alternative content for browsers which do not
                  support iframe
                  </iframe>
                  

                1. 支持 iframe 的瀏覽器在子窗口中顯示 URL 引用的文檔,通常帶有垂直和/或水平滾動條.這樣的瀏覽器會忽略 iframe 元素的內容(即開始標簽 和結束標簽 之間的所有內容).不支持 iframe(或禁用此類支持)的瀏覽器則相反,即處理內容就像 <iframe...></iframe> 標簽不存在.因此,盡管被某些瀏覽器忽略,但內容很重要.

                2. Browsers which support iframe display the document referred to by the URL in a subwindow, typically with vertical and/or horizontal scroll bars. Such browsers ignore the content of the iframe element (i.e. everything between the start tag <iframe...> and the end tag </iframe>). Browsers which do not support iframe (or have such support disabled) does the opposite, i.e. process the content as if the <iframe...> and </iframe> tags were not there. Thus, the content matters, despite being ignored by some browsers.

                  總而言之,內聯框架并不意味著包含功能,盡管它有時可能起到類似的作用.

                  So to summarize, inline frames do not mean an include feature, although it might sometimes serve similar purposes.

                  請注意,當使用內聯框架時,瀏覽器(如果它支持它們)會向 iframe 元素中的 URL 引用的服務器發送請求,并在獲取請求的文檔將其顯示在一個內聯框架內.從這個意義上說,內聯框架是一個聯合瀏覽器-服務器問題,但只有瀏覽器需要專門識別 iframe;從服務器的角度來看,這只是一個對文檔的普通 HTTP 請求,它發送文檔而不知道(或不需要)瀏覽器將要做什么.

                  Note that, when inline frames are used, the browser (if it supports them) sends a request to the server referred to by the URL in the iframe element, and after getting the requested document displays it inside an inline frame. In this sense inline frames are a joint browser-server issue, but only the browser needs to be specifically iframe-aware; from the server's point of view, there's just a normal HTTP request for a document, and it sends the document without having (or needing) any idea on what the browser is going to do with it.

                  根據 最佳實踐,在切換到 iframe 時,您需要如下誘導 WebDriverWait:

                  As per the best practices while switching to an iframe you need to induce WebDriverWait as follows:

                  • 切換Frame Name(Java 示例代碼):

                  • Switch through Frame Name (Java Sample Code):

                  new WebDriverWait(driver, 20).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.name("frame_name")));
                  

                3. 切換 iframe XPath(Python 示例代碼):

                4. Switch through iframe XPath (Python Sample Code):

                  WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"http://iframe[@id='ptifrmtgtframe' and @name='TargetContent']")))
                  

                5. 切換iframe CssSelector(C#示例代碼):

                  new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(By.CssSelector("iframe#twitter-widget-0")));
                  

                6. 您可以在以下位置找到一些相關討論:

                  You can find a couple of relevant discussions in:

                  • Python:如何選擇一個 html 元素,無論它在 selenium 中的哪個框架中?
                  • Java:是否可以在 Selenium Webdriver Java 中不使用 driver.switchTo().frame(frameName") 切換到框架中的元素?李>
                  • C#:如何在定位元素之前等待框架加載?

                  內嵌幀與普通幀

                  這篇關于iframe下處理#document的方法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)

                7. <legend id='UA8Vc'><style id='UA8Vc'><dir id='UA8Vc'><q id='UA8Vc'></q></dir></style></legend>
                  1. <small id='UA8Vc'></small><noframes id='UA8Vc'>

                      <tbody id='UA8Vc'></tbody>

                        <bdo id='UA8Vc'></bdo><ul id='UA8Vc'></ul>

                        <tfoot id='UA8Vc'></tfoot>
                          <i id='UA8Vc'><tr id='UA8Vc'><dt id='UA8Vc'><q id='UA8Vc'><span id='UA8Vc'><b id='UA8Vc'><form id='UA8Vc'><ins id='UA8Vc'></ins><ul id='UA8Vc'></ul><sub id='UA8Vc'></sub></form><legend id='UA8Vc'></legend><bdo id='UA8Vc'><pre id='UA8Vc'><center id='UA8Vc'></center></pre></bdo></b><th id='UA8Vc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UA8Vc'><tfoot id='UA8Vc'></tfoot><dl id='UA8Vc'><fieldset id='UA8Vc'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 精品欧美色视频网站在线观看 | 精品亚洲一区二区三区四区五区高 | 最近最新中文字幕 | 久久久亚洲一区 | 国产日韩一区二区三免费高清 | 91精品国产综合久久久久蜜臀 | 久久久久久999 | 欧美视频在线免费 | 成在线人视频免费视频 | 久久成人免费 | 99热.com| 欧美成人免费在线视频 | 亚洲欧美成人在线 | 三级成人在线 | 欧美三级在线 | 国产视频一区二区三区四区五区 | 国产高清毛片 | 国产成人精品午夜 | www狠狠爱com| 午夜精品一区二区三区在线视 | 在线观看视频91 | 一区二区三区在线免费看 | 日韩国产精品一区二区三区 | 亚洲天堂久久 | 国产精品九九九 | 91香蕉| 国产清纯白嫩初高生在线播放视频 | 欧美激情一区二区三区 | 99免费在线视频 | 午夜精品一区二区三区在线播放 | 日本成人在线播放 | 亚洲日本中文 | 天堂网色 | 久久婷婷香蕉热狠狠综合 | 亚洲高清在线观看 | 久久美国 | 中文字幕成人 | 国产精品视频免费播放 | 久久av网 | 色资源在线观看 | 日韩精品专区在线影院重磅 |