Step-1.
Click the link from the parent window.The new window gets opened. Say it as a child window.Step-2.
In child window, not able to enter data in the field using selenium webDriver.
code:
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
String parentWindowHandle = driver.getWindowHandle();
driver.findElement(By.xpath("//*[@id='topButtonRow']/input[5]")).click();
Thread.sleep(5000);
Set<String> windowHandles = driver.getWindowHandles();
System.out.println(windowHandles.size());
Iterator<String> it = windowHandles.iterator();
String wHandle = null;
while (it.hasNext()) {
wHandle = it.next();
driver.switchTo().window(wHandle);
if (driver.getCurrentUrl().equals("https://uat.omnilife.com.au/OmniLifeWeb/#/quotes/300020fb-e61b-439a-b5d1-5459976ee59b?crmReferenceId=006p0000004VCAE&page=client&save=true&complete=true")) {
{
driver.findElement(By.xpath("//*[@id='client-occupation']")).sendKeys("Comput");
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.findElement(By.linkText("[ Computing Professional ]")).click();
driver.findElement(By.xpath("//*[@id='update-client']")).click();
driver.findElement(By.xpath("//*[@id='trmCheck']")).isSelected();
driver.findElement(By.xpath("//*[@id='quote-settings']/div[1]/div[2]/div/div[1]/div[2]/input")).sendKeys("50000");
driver.findElement(By.xpath("//*[@id='quoteResultGrid']/div/div[6]/div/div[1]/div/table/tbody/tr[1]/td[1]/div/input")).isSelected();
driver.findElement(By.xpath("//*[@id='saveToCRMBulk']")).click();
}
}
driver.switchTo().window(parentWindowHandle);
@id='client-occupation'
element is not text field but some element above it, or you have a frame that you need to switch to in the child window?