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

      <tfoot id='KGjaD'></tfoot>
      1. <small id='KGjaD'></small><noframes id='KGjaD'>

        <legend id='KGjaD'><style id='KGjaD'><dir id='KGjaD'><q id='KGjaD'></q></dir></style></legend>
          <bdo id='KGjaD'></bdo><ul id='KGjaD'></ul>
      2. 如何通过 selenium-webdriver 和 Java 使用 java 鼠标悬停

        时间:2023-06-27

          <legend id='6x8Gb'><style id='6x8Gb'><dir id='6x8Gb'><q id='6x8Gb'></q></dir></style></legend>

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

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

                1. 本文介绍了如何通过 selenium-webdriver 和 Java 使用 java 鼠标悬停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在尝试自动化门户 http://demo.nopcommerce.com/ 时,我无法选择鼠标悬停在电子"菜单上,然后选择相机和照片"子菜单.使用下面的脚本.

                  While trying to automate the portal http://demo.nopcommerce.com/, am not able to select mouse hover over "Electornics" menu and select "Camera & Photo" sub menu. Used the below script for the same.

                  WebElement electronic_Pdts = driver.findElement(By.xpath("//*[@class='title']//*[@title='Show products in category Electronics']"));
                  action.moveToElement(electronic_Pdts).build().perform();
                  driver.findElement(By.xpath("//*[@src='http://demo.nopcommerce.com/images/thumbs/0000006_camera-photo_450.jpeg']")).click();
                  

                  推荐答案

                  鼠标悬停"Electornics"strong> 菜单并选择 "Camera & Photo" 您可以使用以下代码块:

                  To Mouse Hover over "Electornics" menu and select "Camera & Photo" you can use the following code block :

                  driver.get("http://demo.nopcommerce.com/");
                  Actions act = new Actions(driver);
                  WebDriverWait wait = new WebDriverWait(driver, 10);
                  WebElement electronics = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//li/a[@href='/electronics']")));
                  act.moveToElement(electronics).perform();
                  WebElement camera_n_photo = driver.findElement(By.xpath("//li/a[@href='/electronics']//following::ul/li/a"));
                  camera_n_photo.click();
                  System.out.println("Camera & photo Clicked.");
                  

                  这篇关于如何通过 selenium-webdriver 和 Java 使用 java 鼠标悬停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:运行 selenium 远程驱动程序时出现带有 NativeConstructorAccessorImpl.newIns 下一篇:从渲染器接收消息超时

                  相关文章

                  <tfoot id='F1A5k'></tfoot><legend id='F1A5k'><style id='F1A5k'><dir id='F1A5k'><q id='F1A5k'></q></dir></style></legend>

                    1. <small id='F1A5k'></small><noframes id='F1A5k'>

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