I need to move element from outside an iframe into an iframe. My element panel is not part of iframe but my canvas is in the iframe and want to move element into it.
I tried below code :
element_source = self._selenium.find_element(By.XPATH,
'//div[@class="gjs-block-label"][contains(.,"Tooltip")]')
element_target=self._selenium.find_element(By.CLASS_NAME,'gjs-frame')
actions = ActionChains(self._driver)
actions.drag_and_drop(element_source, element_target).perform()
time.sleep(5)
It looks like the issue is that I have to switch to the iframe before I move element, but here I don't see that possibility because drag_and_drop is combined method where my element_source is out of the iframe and element_target is the iframe itself.
So if I switch before drag and drop, it can't find even element_source.
Here is demo page where I am working on : https://grapesjs.com/demo.html
In above demo left side is iframe and right panel is collection of elements.