I have this fragment of my HTML code:
<a class="button-color1 full" href="/AntecipacaoRecebiveis/AntecipacaoAutomatica">Simule e contrate</a> </div>
<div class="interntab clenitab" id="tabs-2">
<div class="row">
<div class="col-xs-8 col-sm-9 taxa-mes" style="text-align:center">
<span class="caption-value">a ser creditado em sua conta</span><br />
<span class="value-simulator">R$ 0,00</span>
</div>
<div class="col-xs-4 col-sm-3 a-ser-creditado" style="padding-top: 24px;">
<span class="caption-value" style="font-size: 13px;line-height:6px">Taxa a.m.</span><br />
<span class="value-simulator" style="font-size: 20px;line-height:8px">2,50%</span>
</div>
</div>
Then, I'm trying to automate my test by clicking on the onclick="SetAdquirente('ADIQ')
(I had success on many other steps from the same website), but it is generating the following error:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document (Session info: chrome=59.0.3071.115) (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.1.7601 SP1 x86_64)
My code to find it is:
elem = driver.find_element_by_id('tabs-2')
action.move_to_element(elem)
action.click()
action.perform()
Why is this happening? (I've tried to use others find_element statements, such as xpath, link text, etc and the same result raises)
Thanks a lot!