Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

» Selenium IDE Verify different Maps (Hybridview, Mapview etc.)
Fri Nov 25, 2016 9:56 pm by DJ87

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

ElementNotVisibleException although element can be selected by the user

View previous topic View next topic Go down

ElementNotVisibleException although element can be selected by the user

Post by Sellj on 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");

Sellj

Posts : 3
Join date : 2012-09-28

Back to top Go down

Re: ElementNotVisibleException although element can be selected by the user

Post by Sourav on 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.

Sourav
Active particpant
Active particpant

Posts : 17
Join date : 2012-06-28

Back to top Go down

Re: ElementNotVisibleException although element can be selected by the user

Post by ashish_techie on 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

ashish_techie
Amateur
Amateur

Posts : 73
Join date : 2011-08-09

Back to top Go down

Re: ElementNotVisibleException although element can be selected by the user

Post by Sponsored content Today at 10:57 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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