Is it possible to get the next sibling by using by.cssContainingText()
Example: HTML code is like below:
Using Xpath selectors is not a better choice as it slows down the element finding mechanism.
I have designed a plugin to address this specific issues: protractor-css-booster
The plugin provides some handly locators to find out siblings in a better way and most importantly with CSS selector.
using this plugin, you can directly use:
var elem = await element(by.cssContainingText('div.text-label','SomeText')).nextSibling();
or, use booster as by-locator
var elem = element(by.cssContainingText('div.text-label','SomeText')).element(by.followingSibling('div'));
Hope, it will help you...