Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium WebDriver Integration
Tue Nov 21, 2017 1:06 pm by azharuddin

» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

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


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