The HTML is as follows:
<div id="button-1600" class="x-btn x-box-item x-toolbar-item x-btn- default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-width: 1px; left: 109px; margin: 0px; top: 0px;">
<em id="button-1600-btnWrap">
<button id="button-1600-btnEl" class="x-btn-center" autocomplete="off" role="button" hidefocus="true" type="button" style="height: 14px;">
<span id="button-1600-btnInnerEl" class="x-btn-inner" style="">QA View</span>
<span id="button-1600-btnIconEl" class="x-btn-icon "></span>
</button>
I need to select the button "QA View". Since our software uses extJS, the ID # (1600) changes everytime the page is loaded. I tried using the long xpath such as follows:
DP_DEALER_SEARCH_QA_VIEW = 'html/body/div[1]/div[3]/div/div/div[2]/div/div/div/div/div/div[2]/em/button'
def click_dealerSearchQAView(self):
webQABtn = WebDriverWait(self.driver, 10).until(
ec.element_to_be_clickable((By.XPATH, DP_DEALER_SEARCH_QA_VIEW)))
webQABtn.click()
I know there are ways to find this element using the shorter XPath method and things such as [Contains], but I haven't been able to figure it out. Any help is greatly appreciated.