abhishek kumar gupta
abhishek kumar gupta

Reputation: 2289

How to automate text writing in popup

I want to automate text writing in popup. Is it possible? if yes, then please guide me. Any help will be well appreciated.

Upvotes: 1

Views: 3436

Answers (2)

abhishek kumar gupta
abhishek kumar gupta

Reputation: 2289

I got the solution:

driver.switchTo().frame(0);
driver.findElement(By.id("id of the view to enter text in the popup")).sendKeys("some text to enter");

Upvotes: 2

jgode
jgode

Reputation: 1869

If it's a browser popup, it sounds like you're looking for:

driver.switchTo().alert().sendKeys("some text to enter");

Upvotes: 2

Related Questions