简体   繁体   中英

How to click on button on Popup Window in Selenium Webdriver by using Java

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||||| 在此处输入图片说明

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM