I'm creating a bot for a matching game, where you drag and drop tiles onto another. Is there an alternative for Selenium Action Chains Drag and Drop that will finish faster?
I've noticed that in Selenium Action Chains Drag and Drop, the process is animated, with the source element actually being dragged onto the destination element. Is there an alternative that does not show the dragging, but solely performs it?
Using a webscraper, I've created two lists - one with the questions, another with the corresponding answers. Here is the relevant part of my code:
for question in questions:
source_element = driver.find_element_by_xpath('//div[text()="{}"]'.format(question))
ans_location = questions.index(question)
dest_element = driver.find_element_by_xpath('//div[text()="{}"]'.format(answers[ans_location]))
ActionChains(driver).drag_and_drop(source_element, dest_element).perform()
I expected the process (with about 15 items in the lists) to finish in ~ 2.5 seconds, but it usually takes a little over 5 seconds. Again, is there a faster alternative?