I have to identity an element in the following HTML:
<main-nav-bar _nghost-oyw-6="">
<div class="navigation-bar" _ngcontent-oyw-6="">
<button _ngcontent-oyw-6="">Entities</button>
<button _ngcontent-oyw-6="">Entity settings</button>
<button _ngcontent-oyw-6="">Batches</button>
<button _ngcontent-oyw-6="">Documents</button>
</div>
</main-nav-bar>
</div>
The element I'm interested in is the one containing 'Entity settings'. I think the best way would be css or xpath but so far I haven't been able to identity one that works. My test keeps on failing. Any ideas?
css = "div.header-bar > main-nav-bar > div.navigation-bar:nth-child(2)"means that you want to match seconddiv, but notbutton. You can trycss = "div.header-bar > main-nav-bar > div.navigation-bar > button:nth-child(2)"or simplexpath = "//button[text()='Entity settings']"