1

I have the html in my Page:

enter image description here

I have the content defined as:

child_criteria(wait: true) { $("div",class:"childSelectInIndex").find("ul",class:"oldSelectIndex") }

trying to select only the number of visible element those do not have style="dsplay:none" with :

def displayedchild_count =  child_criteria.find("li",class:"targetChildAgeForm").not("li",class:"targetChildAgeForm",style:"display:none;").size()

But println displayedchild_count always show the size as 4.

How I can select the size of visible elements?

1 Answer 1

0

You should be able to do:

def visibleLis = $("div.childSelectInIndex ul.oldSelectIndex li.targetChildAgeForm")
                      .findAll { it.displayed }
2
  • Thanks a lot. It worked. Can you please let me know what was the problem in my code? Sep 23, 2016 at 9:38
  • Not sure, I've never done visibility checking that way :-(
    – tim_yates
    Sep 23, 2016 at 10:08

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.