I am trying to click a tab called source control, that tab has an id which is dynamically generated.on looking online, tried below methods but still no use
Tried the below XPath:
//li[@class="menu-item"]/a/strong[text(),Source Control]')
//li[@class="menu-item"]//a//text()[preceding-sibling::strong][normalize-space()!='']
//li//a[starts-with(id,"aui-uid-")]/strong[text(),Source Control]
Code that I am using
Sourcecontrol=driver.find_element_by_xpath('//li[@class="menu-item"]/a/strong[text(),Source Control]')
if not Sourcecontrol:
print("No element found")
else:
Sourcecontrol.click();
HTML
<li class="menu-item" role="presentation">
<a href="link" id="aui-uid-4" role="tab" aria-selected="false"><strong>Source Control</strong></a>
</li>