[quote:341ya0qm] Offset within element cannot be scrolled into view[/quote:341ya0qm]
where do you want to scroll? is it on screen?
Vertical scroll is displayed outside the screen. Iam trying to drag image from right hand section to section that is in the middle
[attachment=0:1earkf2n]drag&dropscroll.png[/attachment:1earkf2n]
That means it is not possible through selenium??
Note: we no need to scroll down before drag & drop. on page load, itself all images are visible.
[quote:2mf3ue3s]That means it is not possible through selenium??
[/quote:2mf3ue3s]
no, it is possible. just keep in mind that both drag and drop location should be visible on screen.
In this scenario, both drag and drop are visible in the screen without scrolling.
on page load itself, both drag and drop are visible
As build is placed in our Internal server,URL cannot be accessed. Below is code:
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.interactions.Actions;
public class Drag_Drop_S2KGraphics {
public static void main(String[] args) throws InterruptedException {
FirefoxProfile prof = new FirefoxProfile();
prof.setEnableNativeEvents(true);
WebDriver d = new FirefoxDriver(prof);
d.manage().window().maximize();
d.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
d.navigate().to("http://172.16.33.121/S2kGraphics/Web/Aspx/Login.aspx");
d.findElement(By.xpath("//*[@id='txtUserName']")).sendKeys("admin");
d.findElement(By.xpath("//*[@id='txtPassword']")).sendKeys("password");
d.findElement(By.xpath("//*[@id='btnSignIn']")).click();
d.findElement(By.xpath("//*[@id='canvas']/div[1]/section/div/div[1]/div"));
WebElement a = d.findElement(By.xpath("//*[@id='grdBrandList']/tbody/tr[13]/td[1]"));
JavascriptExecutor JE = ((JavascriptExecutor) d);
JE.executeScript("arguments[0].scrollIntoView(true);", a);
a.click();
d.findElement(By.xpath("//*[@id='gvMyCampaign']/tbody/tr[2]/td[1]")).click();
d.findElement(By.xpath("//*[@id='btnEdit']")).click();
d.findElement(By.xpath("//*[@id='btnContinue']")).click();
WebElement drag = d.findElement(By.xpath("//*[@id='gallery']/li[4]/div[1]"));
WebElement drop = d.findElement(By.xpath("//*[@id='divStyle_1_Logo_1']"));
Actions act = new Actions(d);
act.dragAndDrop(drag, drop).build().perform();
}
}
[quote:11fghboj]URL cannot be accessed[/quote:11fghboj]
ok can you come on skype or team viewer?