Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
Sellj
Posts : 3
Join date : 2012-09-28

ElementNotVisibleException although element can be selected by the user Empty ElementNotVisibleException although element can be selected by the user

Sat Sep 29, 2012 7:08 pm
The following test fails with org.openqa.selenium.ElementNotVisibleException because one of the parent css elements contains a "hidden: none;". However, the element for the user is visable and can be selected. Hence, I would like to test it. Is there any way to work around that problem? It seems I cannot edit the css.

code of test

Code:
FirefoxProfile profile = new FirefoxProfile(new File("/path/to/firefoxprofile"));
profile.setEnableNativeEvents(true);
driver = new FirefoxDriver(profile);
driver.manage().timeouts().implicitlyWait(16, TimeUnit.SECONDS);
driver.get("URL");  <== I couldn't enter the real URL since new members are not allowed to enter any Link within the first 7 days (the link is h t t p : / / w w w . a u t o s c o u t 2 4 . d e)
driver.findElement(By.linkText("Werkstattsuche")).click();
WebElement plzField = driver.findElement(By.id("cms-plz"));
plzField.sendKeys("81243");
driver.findElement(By.cssSelector("span.buttonBob span input[value='Werkstätten finden']")).click();
driver.findElement(By.linkText("Inspektion (mit Preis)")).click();
Select selectMarke = new Select(driver.findElement(By.cssSelector("select.inputL[name='MakeId']")));
selectMarke.selectByVisibleText("BMW");
avatar
Sourav
Active particpant
Active particpant
Posts : 17
Join date : 2012-06-28

ElementNotVisibleException although element can be selected by the user Empty Re: ElementNotVisibleException although element can be selected by the user

Mon Oct 08, 2012 5:51 pm
Hi,
If this particular item's 'hidden' attribute is changed by some functions, you can 'sleep' for few millisecs after opening the page.
avatar
ashish_techie
Amateur
Amateur
Posts : 73
Join date : 2011-08-09

ElementNotVisibleException although element can be selected by the user Empty Re: ElementNotVisibleException although element can be selected by the user

Wed Oct 31, 2012 12:54 am
you can use this logic

while(element.isDisplayed()){
Thread.sleep(1000)
}

This will wait till emenet is visible


Regards
Ashish

For selenium tutorials:
www.qtpselenium.com/selenium-tutorials
Sponsored content

ElementNotVisibleException although element can be selected by the user Empty Re: ElementNotVisibleException although element can be selected by the user

Back to top
Permissions in this forum:
You cannot reply to topics in this forum