isElementPresent () . This method basically checks if the element we are looking for is present somewhere on the page.
isVisible () - looks for a display: there is no style tag - this can cause a null pointer if we are not careful ... so that to see if an element is visible, first check if the element is present using the isElementPresent () method. Then try to check if the item is visible!
Please note that isElementPresent () will not mind even if our item is not displayed.
For example: let's say below: the html code for the component in my test application:
now if you test the above component with
selenium.isElementPresent("testinput") - returns true! selenium.isVisible("testinput") - returns false!
Sachin mhetre
source share