How to click on an element which is visible after mouse hover over an element within ebay.com using Selenium and JavaHow do I efficiently iterate over each entry in a Java Map?How do I generate random integers within a specific range in Java?how to Click on windows menu which populate on mouse hover using seleniumSelenium WebDriver: clicking on elements within an SVG using XPathHow to mouse hover using javascript executor in selenium 2?Selenium WebDriver - Not able to select value from dropddown, element is not visibleClick Button With No ID Selenium JavaSelenium clicking on a different element on two different machineSelenium WebDriver click on a dropdown after hovering the mouse on a menuHover list of elements - Selenium Java WebDriver

How can I add a .pem private key fingerprint entry to known_hosts before connecting with ssh?

How to expose REST API to external users -- how do they authenticate and authorize to create lead in Salesforce

Can a tourist shoot a gun for recreational purpose in the USA?

Were any of the books mentioned in this scene from the movie Hackers real?

Why does the headset man not get on the tractor?

Re-testing of regression test bug fixes or re-run regression tests?

Extract the characters before last colon

Wireless headphones interfere with Wi-Fi signal on laptop

Show solution to recurrence is never a square

Do not cross the line!

How to cope with regret and shame about not fully utilizing opportunities during PhD?

How do I identify the partitions of my hard drive in order to then shred them all?

What information exactly does an instruction cache store?

Hiker's Cabin Mystery | Pt. VI

Why doesn't Iron Man's action affect this person in Endgame?

Do crew rest seats count towards the maximum allowed number of seats per flight attendant?

How can we allow remote players to effectively interact with a physical tabletop battle-map?

Promotion comes with unexpected 24/7/365 on-call

Single word that parallels "Recent" when discussing the near future

Alias for root of a polynomial

How to not get blinded by an attack at dawn

Biology of a Firestarter

Can I say: "When was your train leaving?" if the train leaves in the future?

Find the unknown area, x



How to click on an element which is visible after mouse hover over an element within ebay.com using Selenium and Java


How do I efficiently iterate over each entry in a Java Map?How do I generate random integers within a specific range in Java?how to Click on windows menu which populate on mouse hover using seleniumSelenium WebDriver: clicking on elements within an SVG using XPathHow to mouse hover using javascript executor in selenium 2?Selenium WebDriver - Not able to select value from dropddown, element is not visibleClick Button With No ID Selenium JavaSelenium clicking on a different element on two different machineSelenium WebDriver click on a dropdown after hovering the mouse on a menuHover list of elements - Selenium Java WebDriver






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to learn selenium with java using ebay.com. I found a difficult element to select element after mouse hover. Here is my snippet code



driver.findElement(By.xpath("//a[contains(text(),'Tennis')]")).click()


However above code return error element not interactable



I have add Thread.sleep(60000) before driver.findElement and still not able to click



here is the window i wanted to click



enter image description here










share|improve this question
























  • Try a more specific xpath and test that you can click anything. For instance, find an element with an id on ebay and see if you are able to click that. If you can, then you know that the problem is with your xpath selector.

    – Paul Nikonowicz
    Mar 23 at 15:24

















0















I am trying to learn selenium with java using ebay.com. I found a difficult element to select element after mouse hover. Here is my snippet code



driver.findElement(By.xpath("//a[contains(text(),'Tennis')]")).click()


However above code return error element not interactable



I have add Thread.sleep(60000) before driver.findElement and still not able to click



here is the window i wanted to click



enter image description here










share|improve this question
























  • Try a more specific xpath and test that you can click anything. For instance, find an element with an id on ebay and see if you are able to click that. If you can, then you know that the problem is with your xpath selector.

    – Paul Nikonowicz
    Mar 23 at 15:24













0












0








0








I am trying to learn selenium with java using ebay.com. I found a difficult element to select element after mouse hover. Here is my snippet code



driver.findElement(By.xpath("//a[contains(text(),'Tennis')]")).click()


However above code return error element not interactable



I have add Thread.sleep(60000) before driver.findElement and still not able to click



here is the window i wanted to click



enter image description here










share|improve this question
















I am trying to learn selenium with java using ebay.com. I found a difficult element to select element after mouse hover. Here is my snippet code



driver.findElement(By.xpath("//a[contains(text(),'Tennis')]")).click()


However above code return error element not interactable



I have add Thread.sleep(60000) before driver.findElement and still not able to click



here is the window i wanted to click



enter image description here







java selenium selenium-webdriver webdriver webdriverwait






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 15:45









DebanjanB

49.7k144995




49.7k144995










asked Mar 23 at 14:42









J. DoemJ. Doem

16510




16510












  • Try a more specific xpath and test that you can click anything. For instance, find an element with an id on ebay and see if you are able to click that. If you can, then you know that the problem is with your xpath selector.

    – Paul Nikonowicz
    Mar 23 at 15:24

















  • Try a more specific xpath and test that you can click anything. For instance, find an element with an id on ebay and see if you are able to click that. If you can, then you know that the problem is with your xpath selector.

    – Paul Nikonowicz
    Mar 23 at 15:24
















Try a more specific xpath and test that you can click anything. For instance, find an element with an id on ebay and see if you are able to click that. If you can, then you know that the problem is with your xpath selector.

– Paul Nikonowicz
Mar 23 at 15:24





Try a more specific xpath and test that you can click anything. For instance, find an element with an id on ebay and see if you are able to click that. If you can, then you know that the problem is with your xpath selector.

– Paul Nikonowicz
Mar 23 at 15:24












2 Answers
2






active

oldest

votes


















1














Hover to Sports menu using Actions and when menu opens click to the Tennis submenu. To wait for Tennis to be clickable use WebDriverWait:



WebDriverWait wait = new WebDriverWait(driver, 5);
Actions actions = new Actions(driver);

driver.get("https://www.ebay.com");

WebElement sports = driver.findElement(By.linkText("Sports"));

actions.moveToElement(sports).perform();
wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Tennis"))).click();





share|improve this answer






























    1














    You need to Mouse Hover over the element with text as Sports and wait for the elementToBeClickable() with text as Tennis and you can use the following solution:




    • Code Block:



      System.setProperty("webdriver.chrome.driver", "C:\Utility\BrowserDrivers\chromedriver.exe");
      ChromeOptions options = new ChromeOptions();
      options.addArguments("start-maximized");
      options.addArguments("--disable-extensions");
      //options.addArguments("disable-infobars");
      WebDriver driver = new ChromeDriver(options);
      driver.get("https://www.ebay.com/");
      new Actions(driver).moveToElement(new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Sports")))).perform();
      new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[text()='Sports']//following::div[@class='hl-cat-nav__flyout']//span[text()='Other Categories']//following::ul[1]/li/a[normalize-space()='Tennis']"))).click();


    • Browser Snapshot:


    ebay






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314887%2fhow-to-click-on-an-element-which-is-visible-after-mouse-hover-over-an-element-wi%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Hover to Sports menu using Actions and when menu opens click to the Tennis submenu. To wait for Tennis to be clickable use WebDriverWait:



      WebDriverWait wait = new WebDriverWait(driver, 5);
      Actions actions = new Actions(driver);

      driver.get("https://www.ebay.com");

      WebElement sports = driver.findElement(By.linkText("Sports"));

      actions.moveToElement(sports).perform();
      wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Tennis"))).click();





      share|improve this answer



























        1














        Hover to Sports menu using Actions and when menu opens click to the Tennis submenu. To wait for Tennis to be clickable use WebDriverWait:



        WebDriverWait wait = new WebDriverWait(driver, 5);
        Actions actions = new Actions(driver);

        driver.get("https://www.ebay.com");

        WebElement sports = driver.findElement(By.linkText("Sports"));

        actions.moveToElement(sports).perform();
        wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Tennis"))).click();





        share|improve this answer

























          1












          1








          1







          Hover to Sports menu using Actions and when menu opens click to the Tennis submenu. To wait for Tennis to be clickable use WebDriverWait:



          WebDriverWait wait = new WebDriverWait(driver, 5);
          Actions actions = new Actions(driver);

          driver.get("https://www.ebay.com");

          WebElement sports = driver.findElement(By.linkText("Sports"));

          actions.moveToElement(sports).perform();
          wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Tennis"))).click();





          share|improve this answer













          Hover to Sports menu using Actions and when menu opens click to the Tennis submenu. To wait for Tennis to be clickable use WebDriverWait:



          WebDriverWait wait = new WebDriverWait(driver, 5);
          Actions actions = new Actions(driver);

          driver.get("https://www.ebay.com");

          WebElement sports = driver.findElement(By.linkText("Sports"));

          actions.moveToElement(sports).perform();
          wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Tennis"))).click();






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 23 at 15:43









          SersSers

          3,3202220




          3,3202220























              1














              You need to Mouse Hover over the element with text as Sports and wait for the elementToBeClickable() with text as Tennis and you can use the following solution:




              • Code Block:



                System.setProperty("webdriver.chrome.driver", "C:\Utility\BrowserDrivers\chromedriver.exe");
                ChromeOptions options = new ChromeOptions();
                options.addArguments("start-maximized");
                options.addArguments("--disable-extensions");
                //options.addArguments("disable-infobars");
                WebDriver driver = new ChromeDriver(options);
                driver.get("https://www.ebay.com/");
                new Actions(driver).moveToElement(new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Sports")))).perform();
                new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[text()='Sports']//following::div[@class='hl-cat-nav__flyout']//span[text()='Other Categories']//following::ul[1]/li/a[normalize-space()='Tennis']"))).click();


              • Browser Snapshot:


              ebay






              share|improve this answer



























                1














                You need to Mouse Hover over the element with text as Sports and wait for the elementToBeClickable() with text as Tennis and you can use the following solution:




                • Code Block:



                  System.setProperty("webdriver.chrome.driver", "C:\Utility\BrowserDrivers\chromedriver.exe");
                  ChromeOptions options = new ChromeOptions();
                  options.addArguments("start-maximized");
                  options.addArguments("--disable-extensions");
                  //options.addArguments("disable-infobars");
                  WebDriver driver = new ChromeDriver(options);
                  driver.get("https://www.ebay.com/");
                  new Actions(driver).moveToElement(new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Sports")))).perform();
                  new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[text()='Sports']//following::div[@class='hl-cat-nav__flyout']//span[text()='Other Categories']//following::ul[1]/li/a[normalize-space()='Tennis']"))).click();


                • Browser Snapshot:


                ebay






                share|improve this answer

























                  1












                  1








                  1







                  You need to Mouse Hover over the element with text as Sports and wait for the elementToBeClickable() with text as Tennis and you can use the following solution:




                  • Code Block:



                    System.setProperty("webdriver.chrome.driver", "C:\Utility\BrowserDrivers\chromedriver.exe");
                    ChromeOptions options = new ChromeOptions();
                    options.addArguments("start-maximized");
                    options.addArguments("--disable-extensions");
                    //options.addArguments("disable-infobars");
                    WebDriver driver = new ChromeDriver(options);
                    driver.get("https://www.ebay.com/");
                    new Actions(driver).moveToElement(new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Sports")))).perform();
                    new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[text()='Sports']//following::div[@class='hl-cat-nav__flyout']//span[text()='Other Categories']//following::ul[1]/li/a[normalize-space()='Tennis']"))).click();


                  • Browser Snapshot:


                  ebay






                  share|improve this answer













                  You need to Mouse Hover over the element with text as Sports and wait for the elementToBeClickable() with text as Tennis and you can use the following solution:




                  • Code Block:



                    System.setProperty("webdriver.chrome.driver", "C:\Utility\BrowserDrivers\chromedriver.exe");
                    ChromeOptions options = new ChromeOptions();
                    options.addArguments("start-maximized");
                    options.addArguments("--disable-extensions");
                    //options.addArguments("disable-infobars");
                    WebDriver driver = new ChromeDriver(options);
                    driver.get("https://www.ebay.com/");
                    new Actions(driver).moveToElement(new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Sports")))).perform();
                    new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[text()='Sports']//following::div[@class='hl-cat-nav__flyout']//span[text()='Other Categories']//following::ul[1]/li/a[normalize-space()='Tennis']"))).click();


                  • Browser Snapshot:


                  ebay







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 25 at 15:46









                  DebanjanBDebanjanB

                  49.7k144995




                  49.7k144995



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314887%2fhow-to-click-on-an-element-which-is-visible-after-mouse-hover-over-an-element-wi%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                      Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript