Commit 949460eb authored by Qazi Zain's avatar Qazi Zain

Iframe content is added in repo in this commit

parent 47f73009
package Techniques.IFrame;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.time.Duration;
public class IframeQs {
public static void main(String[] args) {
WebDriver obj = new FirefoxDriver();
obj.get("https://jqueryui.com/droppable/");
WebDriverWait wait = new WebDriverWait(obj, Duration.ofSeconds(5));
obj.switchTo().frame(obj.findElement(By.cssSelector("iframe.demo-frame")));
Actions drag = new Actions(obj);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("draggable")));
drag.dragAndDrop(obj.findElement(By.id("draggable")),obj.findElement(By.id("droppable"))).build().perform();
obj.switchTo().defaultContent();
drag.scrollByAmount(0,500).build().perform();
}
}
  • Kindly add explanation of each line of code that explain why you are using this technique

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment