How to find the id from the Expanding the tree node in selenium web driver using java. can you please put some code and tutorial for this?
I have a folder structure.
1. Click on the + of the folder structure and expand the folder.
2. And again expand the sub- folder and so on till 3 sub- folder.
3. Now select the value from the folder and drag and drop.
Problem: if i get the XPath value of the first folder using find Elements. the error is “Unable to locate element”
Kindly share the code which you have tried for better understanding
FYI , Unable to locate element “- problem arises when
1. Your specified Xpath is wrong – refer http://toolsqa.com/selenium-webdriver/xpath-firebug-firepath/
solution: If you’re using firefox browser , add Plugin call “FireBug” and for chrome http://toolsqa.com/selenium-webdriver/xpath-helper/
2. when you tried to access the element before the page loads – refer http://toolsqa.com/selenium-webdriver/wait-commands/
Solution: Add wait command
Thank you, I can get the XPath value.
Please see the below code.
WebElement From = driver.findElement(By.xpath(“//div[@id=”]/div”)); –> Getting the Xpath value from the source location.
WebElement To = driver.findElement(By.xpath(“//div[@id=”]/div”)); –> getting the xpath value from the traget location
Actions action = new Actions(driver);
action.dragAndDrop(From, To).build().perform(); –> When this code is running the value is not dropping in the location where it has to drop. It keeps it with cursor . I have to manuelly click on that location to drop the value.
Any Help would be appreciated.
I tried your code it gives element not found error.
Any suggestion how to find the element.