When using the explicit text it works and the found element is clicked on but not when I use the variable:
This is the div: <div unselectable="on" class="x-grid3-cell-inner x-grid3-col-object_name">68915969-LS</div>
This works:
result = driver.find_element(By.XPATH,"//div[contains(text(),'68915969-LS')]")
action = ActionChains(driver)
action.move_to_element(result).click().perform()
When I replace '68915969-LS' by a variable nothing happens (no error, found line is not clicked on):
doc_number = '68915969-LS'
result = driver.find_element(By.XPATH,"//div[contains(text(),doc_number)]")
action = ActionChains(driver)
action.move_to_element(result).click().perform()
Any idea why?
Cheers Daniel