To handle and automate complex web elements such as iframes, pop-ups, or drag-and-drop elements in Selenium, first identify the element using appropriate locators such as ID or XPath.
For iframes, switch to the frame using the driver's switchTo() method. For pop-ups, use the Alert class to handle the pop-up window. For drag-and-drop elements, make use of the Actions class to perform drag-and-drop operations.