Iam not able to work with this page. | Selenium Forum
R
Rupa Posted on 27/06/2020

here is my code. Iam getting no such element is found.

WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.get("http://way2automation.com/demo.html");
//9440776233-sai santhosh jewellery
driver.findElement(By.xpath("//h2[contains(text(),'Draggable')]")).click();
//driver.findElement(By.xpath("//input[@name='name'] ")).sendKeys("Rupa");

//driver.switchTo().frame(1);
Thread.sleep(2000);
driver.findElement(By.xpath("//input[@name='name']")).sendKeys("Rupa");


A
Ashish Thakur Replied on 01/07/2020

driver.findElement(By.xpath("//h2[contains(text(),'Draggable')]")).click();

Thine opens a new tab. You have to switch the control to new tab and then write in it.

Please watch the multiple window management module. In that i have shown how to manage multiple windows and switch from one window to another.