The solution to extract By from WebElement [method getByFromElement() ] will fail when a By contains locator that has parent::a or ancestor::div in its xpath
This is because an extra ':' char in xpath will result in wrong split
Thus instead the split(":"); need to use split(":",2); will work instead