I am trying to automate the process of downloading a file through an online tool. I am using Selenium 3.0.1, and new to it. What am i trying to do?
- Login
- Move to specific element
- From there, Find the element which I need to double click
I am struggling to finding the element. I've done quite a bit of googling but still unable to find the element.
Here is the front end(I don't know how to copy past the html directly):
I am trying to get to the div ext:tree-node-id="xnode-520"
(second last line in the picture) I want to get there but I'm unable to, I'm not sure if the unselectable="on" attribute is effecting that.
Here is my code:
public class Main {
public static void main(String[] args) {
String exePath = "C://Users//user1//Documents//chromedriver.exe";
System.setProperty("webdriver.chrome.driver", exePath);
WebDriver driver = new ChromeDriver();
Actions action = new Actions(driver);
driver.get("website url");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.id("username")).sendKeys("u9");
driver.findElement(By.name("password")).sendKeys("u9");
driver.findElement(By.id("ext-gen24")).click();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
WebElement findElement = driver.findElement(By.id("ext-gen277"));
WebElement findElement2 = driver.findElement(By.id("ext-gen278"));
action.moveToElement(findElement);
action.moveToElement(findElement2);
String genXPath= "//div[@tree-node-id='xnode-520']";
driver.findElement(By.xpath(genXPath)).click();
}
}
I left the website url generic for privacy purpose. I haven't really used the Actions class that much at all. I'm relatively new to this and I'm unaware of this dynamic front end.
EDIT: The exception that is being thrown is that the element is not clickable at point..Other element would receive the click
EDIT #2: Well this seems even more complicated the id numbers are changing everytime the page loads.