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;
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