Dear All,I am working on a jsf web application using selenium/eclipse/java platform. I wanted to click a dynamic menu of application in thisstructure:-Menu------|-------Sub menu|-------------sub-sub menu item *I wanted to click this item but neither xpath is working nor direct call of sub-sub menu item... This problem is becausewebdriver is not able to call the mouseover also no direct click is working as I had tried to call by ID/ClassAll invain...:(... Please anyone can suggest me a solution...Thanks in advance..RegardsSandeep--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/daYPSphc23IJ.
For more options, visit https://groups.google.com/groups/opt_out.
Not true, some corrections/clarifications:
· WebDriver can find any element you can reference with an XPath.
· An element does not have to be visible on the screen to be in the DOM.
· WebDriver will only allow you to perform user actions on elements that are visible to the end user, you can do other things with elements that are not visible.
--
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/daYPSphc23IJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/kzfafyIYA28J.To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/nZwDAKWLP8AJ.To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/ba--r3fod5YJ.To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
Sandy ,
Thanks
If you are using thread.sleep you are doing it wrong. You should use an explicit wait instead.
You test now has 8 seconds of wait time, that means you have added 8 seconds to every test run for no real reason. If you keep doing this your tests will soon take so long to run they will become unusable.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/4aPiq4HHokwJ.
IDE has its roots in Selenium RC.
Selenium RC used to use JavaScript to fire events which meant that you could do things that an end user could not (Like clicking on hidden buttons, interacting with elements off the screen, etc). Selenium RC was a good attempt but had issues that WebDriver has overcome.
WebDriver has been specifically designed to only enable you to do what an end user can do, so you can no longer interact with hidden elements because an end user cannot do this.
If you have test involves you clicking a button that is not visible should it pass? If it does what are you going to do when your website goes live and it turns out that this hidden button is never made visible, your test still passes so there is no bug right, oh hang on yes there is and it’s a biggie!
Do you have a publically visible page showing the functionality you are trying to automate?
From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Sandy
Sent: 27 July 2012 20:16
To: seleniu...@googlegroups.com
Subject: [selenium-users] Re: JSF Menus and Selenium webdriver problem
Now... I just wanna say... I quit :( ..
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/ViTv4RzJK-sJ.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
OK I’ve had a look at it and the HTML is making my eyes bleed. What on earth were they thinking when they designed that??
For a start it’s invalid HTML:
Secondly it seems there are problems waiting for elements to appear based upon mouse overs when using an Actions object.
I’ve automated a scenario where you mouse over the File button and then click the new button, this is however a bit messy:
WebDriver driver = new FirefoxDriver();
//Get the page we are automating
driver.get("http://livedemo.exadel.com/richfaces-demo/richfaces/dropDownMenu.jsf?c=dropDownMenu&tab=usage");
//Find the elements we are going to interact with on the page
WebElement dropDownMenuContainer = driver.findElement(By.xpath("(//div[@class='sample-container'])[1]/descendant::form"));
WebElement dropDownMenuOptionFile = dropDownMenuContainer.findElement(By.xpath("./table/descendant::tr/td/div[div[text()='File']]"));
By dropDownMenuOptionNewLocator = By.xpath("(//div[@class='sample-container'])[1]/descendant::form/table/descendant::tr/td/descendant::div[contains(@class, 'rich-menu-item')][span[.='New']]");
WebElement dropDownMenuOptionNew = dropDownMenuContainer.findElement(dropDownMenuOptionNewLocator);
//Hacky way to get access to the mouse
Mouse mouse = ((HasInputDevices)driver).getMouse();
//Set up an explicit wait object that waits up to 5 seconds for something, checking the condition every 500 ms
WebDriverWait performWait = new WebDriverWait(driver, 5, 500);
//Mouse over the file button
mouse.mouseMove(((Locatable) dropDownMenuOptionFile).getCoordinates());
//Wait for the new button to appear
performWait.until(visibilityOfElementLocated(dropDownMenuOptionNewLocator));
//Mouse over new button
mouse.mouseMove(((Locatable) dropDownMenuOptionNew).getCoordinates());
//Click new button
mouse.click(((Locatable) dropDownMenuOptionNew).getCoordinates());
driver.quit();
We seem to have 2 problems at the moment:
1. It seems that implicit waits don’t work for visibility when using the Actions object.
2. Breaking an actions object into two parts results in the mouse location being lost. So if I create an actions object to do a hover action the mouse seems to be reset to an unknown location after .perform(), so the drop down menu is not made visible whilst the wait condition is taking place resulting in a test failure.
Looks like we have a bug to raise later on J
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/ViTv4RzJK-sJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Ik9tjLOiGUAJ.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/ViTv4RzJK-sJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.