javascript - CSS selector .find(">div.childCollapsible>div[data-onthemovecollapsible=true]") is not respecting parent restriction -


actual case more complicated please play along. trying select siblings of element has class 'sss', using

$('.sss').parent().parent().find(">div.childcollapsible>div[data-onthemovecollapsible=true]") 

i can use css selectors (this part of selenium thest). expected siblings of 'sss' getting children of sub elements too.

how restrict siblings? or other workaround can me element in tree siblings of

data-onthemovecollapsible="true"  

attribute holder.

edit: firstly apologise failing express myself clearly. structure working 'infinite tree structure' has unknown amount of nodes on each layer, mechanism looking ability siblings on same level starting search , children of parent (his brothers + himself). levels of tree have identical html syntax, looking @ them relatively element 1 starts from, each layer identical, hence css selector should identical too. cannot use other jquery method 'find', , can use css selectors, mechanism part of selenium test by.cssselector("...") can used. can traverse elements using element.findelements(by.xpath("..")) gets me parent know how many levels parent is, parent position need siblings without children (that have identical html syntax) in 1 go, assume selector layer should (like 1 in jsfiddle below), selects children nodes - not respect '>' reason. nicely if use jquery functions.

$('.sss').parent().parent().children().children() 

what need same result css selector.

http://jsfiddle.net/2a46u/

i think work you:

.find("body>div>div>div>div.childcollapsible>div[data-onthemovecollapsible=true]") 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -