droefs / HLISA

A reimplementation of the Selenium API, emulating human interactions
https://pypi.org/project/HLISA/
GNU General Public License v3.0
72 stars 8 forks source link

Does not work drag_and_drop_by_offset in iframe #6

Closed johny322 closed 2 years ago

johny322 commented 2 years ago

Hi. I trying to use drag_and_drop_by_offset method with element which is in iframe.

browser: undetected-chromedriver browser.switch_to.frame('frame_id')

HLISA_ActionChains(browser, False).drag_and_drop_by_offset(element, xoffset, 0).perform()

But nothing happens. I tried to use move_by_offset, but it also did not work.

When i use default action chains, it is work good ActionChains(browser).drag_and_drop_by_offset(element, xoffset, 0).perform()

Please, help.

droefs commented 2 years ago

Sorry for the late reply. This problem is difficult to solve, as Selenium does not provide the necessary low-level interactions that are required to implement a solution.

For the moment, HLISA directly executes the Selenium drag_and_drop functions, which should resolve the issue. It does not look human like though (although it looks more human like than the Selenium drag_and_drop functions).

Due to an issue with the webdriver implementations, I cannot test the functionality, as for me Selenium's own ActionChains drag_and_drop() function does not work. I just released the updated package on PyPi, it would be great if you could try it to see whether it works.

johny322 commented 2 years ago

Thank you. I will try the new version

droefs commented 2 years ago

I am sorry, I introduced a bug in the workaround that could cause a MoveTargetOutOfBoundsException error when the drag_and_drop action is followed by an action that moves the cursor. It is fixed in version 1.3.3.