isElementPresent() - This method basically tests if the element we are looking for is present somewhere on the page.
isVisible() - looks for display: none style tag - this might throw a null pointer if we aren't careful...thus to see if an element is visible first check if the element is present using isElementPresent() method. Then try checking if the element is visible!
Observe that isElementPresent() won't mind even if our element is not visible.
For ex:
lets say the below is the html code for a component on my test application:
now if you test the above component with
selenium.isElementPresent("testinput") - returns true!
selenium.isVisible("testinput") - returns false!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…