久久久久久久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())的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  當(dāng)我執(zhí)行以下代碼時:

                  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)
                  

                  我正在處理的網(wǎng)頁肯定包含以下 HTML 代碼,我已嘗試等待適當(dāng)?shù)臅r間來執(zhí)行.

                  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>
                  

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

                  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> 標(biāo)簽,可能不是您想要單擊的所需元素.相反,您的用例必須是單擊 <a href="Link_here"_blank">Title</a> 元素.
                  • 根據(jù)最佳實踐,在調(diào)用 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 升級到當(dāng)前級別 JDK 8u222.
                  • Selenium 已升級到當(dāng)前級別版本 3.141.59.
                  • ChromeDriver 已更新為當(dāng)前 ChromeDriver v77.0 級別.
                  • Chrome 已更新至當(dāng)前 Chrome 版本 77.0 級別.(根據(jù) ChromeDriver v77.0 發(fā)行說明)
                  • 清理你的項目工作區(qū)通過你的IDE重建你的項目只需要依賴.
                  • 如果您的基本 Web 客戶端 版本太舊,請卸載它并安裝最新的 GA 和發(fā)布版本的 Web 客戶端.
                  • 進(jìn)行一次系統(tǒng)重啟.
                  • 非 root 用戶身份執(zhí)行您的 @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.

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

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

                  相關(guān)文檔推薦

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

                            主站蜘蛛池模板: 91久久国产综合久久 | 成人免费在线观看 | 国产99久久精品一区二区300 | 欧美炮房 | 视频一区 亚洲 | 国内久久| 国产精品久久久久久久久久久久久久 | 99久久电影 | 91在线一区二区三区 | 亚洲一区二区中文字幕在线观看 | 欧美亚洲视频在线观看 | 操人视频在线观看 | 午夜专区| 午夜在线小视频 | 一级片av | 日本特黄a级高清免费大片 特黄色一级毛片 | 一区二区三区在线免费观看视频 | 亚洲性视频 | 亚洲欧美在线免费观看 | 伊人色综合久久久天天蜜桃 | 中文字字幕一区二区三区四区五区 | 美女黄18岁以下禁止观看 | 久久久久久毛片免费观看 | 麻豆视频在线看 | 欧美精品一区二区三区在线播放 | 国产精品日女人 | 久久久av中文字幕 | 成人片免费看 | 在线观看精品视频网站 | av在线一区二区三区 | 欧美一级高潮片免费的 | 日韩欧美福利视频 | 综合久久av | 久久久久久久久久久久久久av | 日韩一区二区三区精品 | www.成人免费视频 | 久久久久国产一区二区三区四区 | 国产91久久精品一区二区 | 中文字幕一区二区三区四区五区 | 欧美精品一区二区三区在线 | 精品视频在线一区 |