Please Help me how to click on button on Popup Window in Selenium Webdriver by using Java, i have apply more and more code but i am not success, please help me . I have also attached Please see a lock and give me reply my answer please|||||
Asked
Active
Viewed 5,885 times
0

OarpitO
- 357
- 1
- 10

Saurabh Gupta
- 139
- 2
- 4
- 13
-
Could you share actual navigation URL to reach that page? – Saurabh Gaur Aug 30 '16 at 12:03
-
and steps to navigate to this popup?? – Saurabh Gaur Aug 30 '16 at 12:35
-
Go To Course Page, click on Cooking Fundamentals I, Click on Mise en Place after that see this popup. – Saurabh Gupta Aug 30 '16 at 12:38
-
Why not google for your problem? It would have lead you back to [this](http://stackoverflow.com/questions/19694507/how-to-handle-popup-window-using-selenium-webdriver-with-java) or [this](http://stackoverflow.com/questions/19403949/how-to-handle-pop-up-in-selenium-webdriver-using-java) answered questions about the same topic. – SaschaM78 Aug 30 '16 at 12:38
1 Answers
1
Finally i got it answer
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div/div[4]/div[2]/div[2]/div[2]/div[1]/div/div[3]/div[1]/div/a[15]/div/img")).click();
Set<String> RecipeHandle = driver.getWindowHandles();
System.out.println(RecipeHandle);
for (String handle1 : driver.getWindowHandles())
{
System.out.println(handle1);
driver.switchTo().window(handle1);
}
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div/div[4]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[1]/a[4]")).click();
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div/div[4]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[1]/div[3]/div/div/div[2]/button")).click();
driver.switchTo().window(handle);
driver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS);
Thread.sleep(3000);**
Thanks for erveryone who responding me...

Saurabh Gupta
- 139
- 2
- 4
- 13