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

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

      <bdo id='2Ncbw'></bdo><ul id='2Ncbw'></ul>
    <tfoot id='2Ncbw'></tfoot>
  • <legend id='2Ncbw'><style id='2Ncbw'><dir id='2Ncbw'><q id='2Ncbw'></q></dir></style></legend>
  • <small id='2Ncbw'></small><noframes id='2Ncbw'>

        sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native

        sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) using findElement(By.className()) through Selenium and Java(sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 通過 Selenium 和 Java 使用 findEleme

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

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

            1. <legend id='u8KBg'><style id='u8KBg'><dir id='u8KBg'><q id='u8KBg'></q></dir></style></legend>

                <tfoot id='u8KBg'></tfoot>

                  本文介紹了sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 通過 Selenium 和 Java 使用 findElement(By.className())的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  當我執行以下代碼時:

                  driver.findElement(By.className("qview-product-name")).click();
                  

                  我收到以下錯誤

                  Session ID: d5df6f837164b1738991e8dc09027fe0
                  *** Element info: {Using=class name, value=qview-product-name}
                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                      at java.lang.reflect.Constructor.newInstance(Unknown Source)
                      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
                      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
                      at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
                      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
                      at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
                      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
                      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323)
                      at org.openqa.selenium.remote.RemoteWebDriver.findElementByClassName(RemoteWebDriver.java:412)
                      at org.openqa.selenium.By$ByClassName.findElement(By.java:389)
                      at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:315)
                      at Logins.bcLogin(Logins.java:140)
                      at Exception.main(Exception.java:54)
                  

                  我正在處理的網頁肯定包含以下 HTML 代碼,我已嘗試等待適當的時間來執行.

                  The webpage I am working on definately contains the following HTML code and I have tried waiting an appropriate amount of time to execute.

                  <dd class="qview-product-name">
                      <span class="note">1 x </span>
                                      <a href="Link_here"_blank">Title</a>
                              </dd>
                  

                  我以為我在使用各種方法定位元素方面已經做得很好了,但這讓我很難過.關于我應該如何進行故障排除的任何想法?謝謝!

                  I thought I was getting pretty good at locating elements using the various methods, but this has me stumped. Any ideas on how I should go about troubleshooting? Thanks!

                  推薦答案

                  您需要注意以下幾點:

                  • By.className("qview-product-name") 指的是父 <dd> 標簽,可能不是您想要單擊的所需元素.相反,您的用例必須是單擊 <a href="Link_here"_blank">Title</a> 元素.
                  • 根據最佳實踐,在調用 click() 時,您需要為 elementToBeClickable()WebDriverWait> 并且您可以使用以下任一定位器策略:

                  • By.className("qview-product-name") refers to the parent <dd> tag and perhaps is not the desired element you want to click. Rather your usecase must be to click on the <a href="Link_here"_blank">Title</a> element.
                  • As per best practices, while invoking click() you need to induce you need to induce WebDriverWait for the elementToBeClickable() and you can use either of the following Locator Strategies:

                  linkText:

                  new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.linkText("Title"))).click();
                  

                • cssSelector:

                  new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("dd.qview-product-name a[href='Link_here']"))).click();
                  

                • xpath:

                  new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("http://dd[@class='qview-product-name']//a[@href='Link_here' and text()='Title']"))).click();
                  

                • 確保:

                  • JDK 升級到當前級別 JDK 8u222.
                  • Selenium 已升級到當前級別版本 3.141.59.
                  • ChromeDriver 已更新為當前 ChromeDriver v77.0 級別.
                  • Chrome 已更新至當前 Chrome 版本 77.0 級別.(根據 ChromeDriver v77.0 發行說明)
                  • 清理你的項目工作區通過你的IDE重建你的項目只需要依賴.
                  • 如果您的基本 Web 客戶端 版本太舊,請卸載它并安裝最新的 GA 和發布版本的 Web 客戶端.
                  • 進行一次系統重啟.
                  • 非 root 用戶身份執行您的 @Test.
                  • JDK is upgraded to current levels JDK 8u222.
                  • Selenium is upgraded to current levels Version 3.141.59.
                  • ChromeDriver is updated to current ChromeDriver v77.0 level.
                  • Chrome is updated to the current Chrome Version 77.0 level. (as per ChromeDriver v77.0 release notes)
                  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
                  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
                  • Take a System Reboot.
                  • Execute your @Test as non-root user.

                  這篇關于sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 通過 Selenium 和 Java 使用 findElement(By.className())的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)

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

                          1. <small id='9EbGx'></small><noframes id='9EbGx'>

                              <tbody id='9EbGx'></tbody>

                            主站蜘蛛池模板: 国产精品久久久久久久久久久免费看 | 啪啪毛片| 久久久久久久久久久久一区二区 | 五月综合激情在线 | 亚洲色欧美另类 | 国产午夜精品一区二区三区在线观看 | 在线超碰| 日韩视频精品在线 | 亚洲小视频在线播放 | 国产成人精品一区二 | 亚洲最新在线视频 | 美女久久视频 | 99精品视频免费在线观看 | 亚洲第一在线 | 国产精品一区视频 | 日韩精品视频一区二区三区 | 久久成人人人人精品欧 | 亚洲精品久久国产高清情趣图文 | 9191av| 国产精品1区2区 | 91久久国产综合久久 | 欧洲精品一区 | 久久久网| 久久免费高清视频 | a中文在线视频 | 精品一区二区不卡 | 日韩精品一区二区三区中文字幕 | 国产乱码精品一区二区三区忘忧草 | 国产精品完整版 | 国产在线观看网站 | 国产成人综合在线 | 一级做a爰片久久毛片 | 欧美黑人激情 | 国产99视频精品免费视频7 | 五月天激情综合网 | 成人不卡视频 | 秋霞在线一区 | 亚洲欧美中文日韩在线v日本 | 精品欧美乱码久久久久久1区2区 | 国产精品一区二区不卡 | 九九激情视频 |