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

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

<small id='sTHXi'></small><noframes id='sTHXi'>

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

        Selenium WebDriver 從 CSS 屬性“內容"獲取文本在

        Selenium WebDriver get text from CSS property quot;contentquot; on a ::before pseudo element(Selenium WebDriver 從 CSS 屬性“內容獲取文本在 ::before 偽元素上)
        1. <i id='h3Fx8'><tr id='h3Fx8'><dt id='h3Fx8'><q id='h3Fx8'><span id='h3Fx8'><b id='h3Fx8'><form id='h3Fx8'><ins id='h3Fx8'></ins><ul id='h3Fx8'></ul><sub id='h3Fx8'></sub></form><legend id='h3Fx8'></legend><bdo id='h3Fx8'><pre id='h3Fx8'><center id='h3Fx8'></center></pre></bdo></b><th id='h3Fx8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='h3Fx8'><tfoot id='h3Fx8'></tfoot><dl id='h3Fx8'><fieldset id='h3Fx8'></fieldset></dl></div>

              <small id='h3Fx8'></small><noframes id='h3Fx8'>

              <tfoot id='h3Fx8'></tfoot>
              • <legend id='h3Fx8'><style id='h3Fx8'><dir id='h3Fx8'><q id='h3Fx8'></q></dir></style></legend>

                • <bdo id='h3Fx8'></bdo><ul id='h3Fx8'></ul>
                    <tbody id='h3Fx8'></tbody>

                • 本文介紹了Selenium WebDriver 從 CSS 屬性“內容"獲取文本在 ::before 偽元素上的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試驗證提供的信息無效或不完整"的文字.在 Java 中使用 Selenium/WebDriver 顯示.

                  I am trying to verify the text "The information provided is either invalid or incomplete." is displayed using Selenium/WebDriver in Java.

                  我有以下 HTML:

                  <div id="validationError">
                      <ul>
                          <li>Required: Server Name</li>
                          <li>Required: Receiving Port</li>
                      </ul>
                  </div>
                  

                  使用以下 CSS 代碼:

                  with the following CSS code:

                  #validationError:before {
                      content: 'The information provided is either invalid or incomplete.';
                  }
                  

                  這是我當前的 java 代碼:

                  Here's my current java code:

                  WebElement errorBox = browser.findElement(By.id("validationError"));
                  Assert.assertNotNull("Could not find validation errors", errorBox);
                  
                  System.out.println("Error Explanation: " + error.getCssValue("content") + "
                  ");
                  
                  List<WebElement> errorList = errorBox.findElements(By.tagName("li"));
                  for (WebElement error : errorList) {
                      System.out.println("Error: " + error.getText());
                  }
                  
                  System.out.println("
                  Error Full Text: " + errorBox.getText());
                  

                  這是我上面代碼的輸出:

                  This is my output of the above code:

                  Error Explanation:
                  
                  Error: Required: Server Name
                  Error: Required: Receiving Port
                  
                  Error Full Text: Required: Server Name
                  Required: Receiving Port
                  

                  我似乎找不到驗證文本提供的信息無效或不完整"的方法.被陳列.在 web 元素上調用 getText() 也不會返回預期的字符串,但會在該 div 中顯示任何其他正常文本.有什么想法嗎?

                  I can't seem to find a way to verify the text "The information provided is either invalid or incomplete." is displayed. Calling getText() on the web element also does not return the expected string, but will display any other normal text within that div. Any ideas?

                  推薦答案

                  我不能 100% 確定 WebDriver 是否可以為您檢索偽元素內容.我認為您需要使用Javascript.下面的作品,我測試了.

                  I am not 100% sure if WebDriver can retrieve pseudo element content for you. I think you would need to use Javascript. Below works, I tested.

                  String script = "return window.getComputedStyle(document.querySelector('#validationError'),':before').getPropertyValue('content')";
                  JavascriptExecutor js = (JavascriptExecutor)driver;
                  String content = (String) js.executeScript(script);
                  System.out.println(content);
                  

                  這應該打印出來

                  The information provided is either invalid or incomplete.
                  

                  這篇關于Selenium WebDriver 從 CSS 屬性“內容"獲取文本在 ::before 偽元素上的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  AttributeError: #39;list#39; object has no attribute #39;click#39; using Selenium and Python(AttributeError: list 對象沒有使用 Selenium 和 Python 的屬性 click)
                  How to execute JavaScript in Ruby written Webdriver test?(如何在 Ruby 編寫的 Webdriver 測試中執行 JavaScript?)
                  ElementClickInterceptedException: Message: element click intercepted Element is not clickable error clicking a radio button using Selenium and Python(ElementClickInterceptedException:消息:元素單擊被攔截元素不可點擊錯誤單擊使
                  An error has occured in #39;site url#39;: Uncaught TypeError: Cannot read property #39;getColomnSet#39; of undefined with Selenium and Python(“站點 url中發生錯誤:未捕獲的類型錯誤:無法使用 Selenium 和 Python 讀取未定義
                  CSS Rotate Text Vertical - Extra Space on both sides(CSS垂直旋轉文本 - 兩側的額外空間)
                  Safari CSS Bug: Animation Rotation Direction Incorrect?(Safari CSS Bug:動畫旋轉方向不正確?)
                    <tbody id='Gs33T'></tbody>
                  <tfoot id='Gs33T'></tfoot>
                    <bdo id='Gs33T'></bdo><ul id='Gs33T'></ul>
                    <i id='Gs33T'><tr id='Gs33T'><dt id='Gs33T'><q id='Gs33T'><span id='Gs33T'><b id='Gs33T'><form id='Gs33T'><ins id='Gs33T'></ins><ul id='Gs33T'></ul><sub id='Gs33T'></sub></form><legend id='Gs33T'></legend><bdo id='Gs33T'><pre id='Gs33T'><center id='Gs33T'></center></pre></bdo></b><th id='Gs33T'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Gs33T'><tfoot id='Gs33T'></tfoot><dl id='Gs33T'><fieldset id='Gs33T'></fieldset></dl></div>
                        • <legend id='Gs33T'><style id='Gs33T'><dir id='Gs33T'><q id='Gs33T'></q></dir></style></legend>

                          <small id='Gs33T'></small><noframes id='Gs33T'>

                            主站蜘蛛池模板: 国产精品视频久久 | 一区二区三区国产精品 | 国产亚洲精品精品国产亚洲综合 | 国产亚洲欧美在线视频 | 欧美精品欧美精品系列 | 久久99久久| 国产美女黄色片 | 免费成人在线网站 | 神马久久久久久久久久 | 亚洲午夜视频 | 亚洲国产精品视频 | 神马福利 | 91在线精品秘密一区二区 | 欧美精品在线一区 | 久久亚洲精品国产精品紫薇 | 国产成人精品一区二区三区在线 | 亚洲国产欧美国产综合一区 | 91精品久久久久久久久 | 国产无人区一区二区三区 | 久久99精品久久久久婷婷 | 午夜视频在线免费观看 | 免费在线观看一区二区 | 韩日有码 | 日日摸天天添天天添破 | 日韩在线电影 | 有码一区| 精品久久久久久久久久久久久久久久久 | 久久精品青青大伊人av | 国产亚洲成av人片在线观看桃 | 视频一区中文字幕 | 呦呦在线视频 | 国产精品久久久久久久久久久久 | 在线视频一区二区三区 | 午夜看片| 亚洲成人av在线播放 | 日韩精品一区二 | 国产精品视频在线播放 | 欧美亚洲一区二区三区 | 视频一区在线观看 | 亚洲电影中文字幕 | 精品1区|