java - Selenium Webdriver - Able to locate elements through firebug, but getting nosuchelementexception at Webdriver -


what happens have webpage: main1 following div what's visible in cyan in screenshot above. i've circled bit of text i'm trying find: enter image description here

i've tried xpath , css. both work in firebug , both locate elements fine inside floating div. when run script, nosuchelement exception.

-things i'm suspicious of:

  1. as can see, div call webpage (indicated whole html tree inside div). might reason webdriver goes hell , doesn't find anything. have no idea how tell in window.
  2. the div acts floating pop-up, graying out rest of background page. not sure if has do, might causing trouble too.

i don't think it's necessary, here 1 of css locators i'm using in firepath , works in locating 5040 text.

driver.findelement(by.cssselector(".feature>tbody>tr>td[width='312']") 

so question here is: how locate text in these td's if xpath/css locators work manually not webdriver?

see iframe element - reason getting exception.

you need switch iframe before finding element:

driver.switchto().frame("content") 

or (in case not working due spaces in id):

driver.switchto().frame(driver.findelement(by.cssselector("iframe[id$=content]")); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -