title: XPath to find dynamic parent/ancestor element from current element?
body: <p>I am writing selenium tests for a dynamic material angular web app.  I can successfully locate the element I want, but then I need to go back up the DOM to the nearest <code>&lt;mat-form-field&gt;</code> tag.  I know how to navigate upwards using xpath (<code>By.XPath("../..")</code>) but I don't always know how many elements there will be until I get to the <code>&lt;mat-form-field&gt;</code> tag.  How could I locate that element dynamically?  </p>