In test page there is a link to go to google, when this element is clicked, the google page opens, and the execution stops, how to come back to my test page after google is open, so that remaing elements can be tested?
package com.qspiders;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
public class Find_element_send_click {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
//get the page
driver.get("file:///F:/selenium/selenium_tool/web_driver_projects/test.html");
WebElement element = driver.findElement(By.id("un"));
element.sendKeys("admin");
//element.clear();
driver.findElement(By.name("password")).sendKeys("password");
driver.findElement(By.xpath("//input[@type='checkbox']")).click();
driver.findElement(By.linkText("Google")).click();
driver.findElement(By.xpath("//textarea")).sendKeys("this is text area");
driver.findElement(By.xpath("//input[@type='file']")).sendKeys("F:\\selenium\\selenium_tool\\web_driver_projects\\asd.docx");
driver.findElement(By.xpath("//input[@type='button']")).click();
driver.findElement(By.xpath("//input[@type='radio']")).click();
//select
WebElement selement = driver.findElement(By.xpath("//select[@name = 'city']"));
Select s = new Select(selement);
s.selectByVisibleText("Hubli");
//multi select
WebElement mselement = driver.findElement(By.xpath("//select[@name = 'city1']"));
Select mselement1 = new Select(mselement);
mselement1.selectByVisibleText("Mumbai");
mselement1.selectByVisibleText("Bangalore");
mselement1.deselectByVisibleText("Mumbai");
}
}