javahtmlexistsrft

HTML/Java: .exists() always returns true


I have the following code. The site has a tab that only shows up once something happens. I'm testing to see if the tab is showing up but it always returns true.

if (html_tab1().exists() == true) {
   //Some code
}

I think the problem is the way the html hides the tab. Does .exists() find the tab even when hidden from the HUD? If so, how do I rework the java to check for the tab as either hidden or showing. Thanks!


Solution

  • My problem was fixed by using the following code

    if(html_tab1().ensureObjectIsVisible()  == true) {
        //some code
    }
    

    Still interested to see why none of the others worked. I feel like .isShowing() should have done the job. Thanks for all the help!