Quality Testing

Quality is delighting customers

Can anybody help on "Handling New Windows" in Selenium Webdriver"?

Hello QA,

Can anybody help on "Handling New Windows" in Selenium Webdriver" please... .

Thanks,

Ravi.

Views: 185

Reply to This

Replies to This Discussion

Hi,

It could be done by using "get_window_handles" method. It retrieve the list of window handles used in the session.

In Perl language it can be done using the following code

   my $handles = $driver->get_window_handles;

   $driver->switch_to_window($handles->[1]);
   $driver->close;
   $driver->switch_to_window($handles->[0]);
Hope it will resolve your problem.

Thanks and regards

Amit Nimje : Infocepts Pvt Ltd

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service