javascript - Find out protractor element CSS chain -


for development , debugging purposes know full chain of css i'm asking in methods like:

divelm.element(by.css("article")).element(by.css("tbody > tr")).then(function(elm) {   // there way know here "css chain" of 'elm'? }); 

if debug elm see locator property with:

locator_: { using: 'css selector', value: 'tbody > tr' }, 

but that's locator of last element in chain.

it useful have all, like: divelm, article, tbody > tr in way i'd able debug manually on page see if element exists or not.

update: need is, when protractor selector expectation fails (e.g. using ispresent() method), error shows last selector in chain. handy if whole chain shown.

if want test css chain right browser, easiest way do suggested in excellent article: http://yizeng.me/2014/03/23/evaluate-and-validate-xpath-css-selectors-in-chrome-developer-tools/

that way don't have debug anymore, know right start selector matches (and doesn't)


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -