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
Wifi is sometimes soft blocked by unknown service
Testing blind license applicants
Why is the Advance Variation considered strong vs the Caro-Kann but not vs the Scandinavian?
What is the effect of the Feeblemind spell on Ability Score Improvements?
What do you call the hair or body hair you trim off your body?
Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?
Given 0s on Assignments with suspected and dismissed cheating?
Why does SSL Labs now consider CBC suites weak?
Promotion comes with unexpected 24/7/365 on-call
Is my test coverage up to snuff?
UUID type for NEWID()
Formal Definition of Dot Product
What are the implications of XORing ciphertext with plaintext?
Could a space colony 1g from the sun work?
Using chord iii in a chord progression (major key)
Why did Varys remove his rings?
It is as easy as A B C, Figure out U V C from the given relationship
Does this "yield your space to an ally" rule my 3.5 group uses appear anywhere in the official rules?
c++ conditional uni-directional iterator
Wiring a 4 channel relay - is this possible?
Developers demotivated due to working on same project for more than 2 years
Why do galaxies collide
Does addError() work outside of triggers?
How do I know which cipher suites can be disabled?
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;
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
java selenium selenium-webdriver webdriver webdriverwait
add a comment |
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
java selenium selenium-webdriver webdriver webdriverwait
Try a more specific xpath and test that you can click anything. For instance, find an element with anid
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
add a comment |
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
java selenium selenium-webdriver webdriver webdriverwait
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
java selenium selenium-webdriver webdriver webdriverwait
java selenium selenium-webdriver webdriver webdriverwait
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 anid
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
add a comment |
Try a more specific xpath and test that you can click anything. For instance, find an element with anid
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
add a comment |
2 Answers
2
active
oldest
votes
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();
add a comment |
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:
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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();
add a comment |
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();
add a comment |
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();
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();
answered Mar 23 at 15:43
SersSers
3,3202220
3,3202220
add a comment |
add a comment |
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:
add a comment |
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:
add a comment |
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:
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:
answered Mar 25 at 15:46
DebanjanBDebanjanB
49.7k144995
49.7k144995
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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