Saturday, January 20, 2018

How to Zoom In and Zoom Out browser in Selenium?

With the help of Robot class we can Zoom In or Zoom Out the browsers in Selenium Automation. We need to press CNTRL+ADD (symbol '+') to Zoom In and CTNRL+SUBTRACT (symbol '-') to Zoom Out.

First, I tried with SendKeys() method as shown in the below screenshot for both Firefox and Chrome browsers but it didn't work. Don't know the reason but I suspect that the issue is with latest Selenium WebDriver version.


Check out the below code, where we are using Robot class to Zoom In and Zoom Out. I think the code is self explanatory for you.
Please comment your suggestions and queries on this post. Thanks for reading!!

#seleniumbabu #HappyLearning

4 comments:

  1. Thanks for sharing valuable information and it is useful for onlineitguru provides the best selenium Online Training Hyderabad

    ReplyDelete
  2. Yiioverflow presenting one of the best and high performance PHP framework. Fast, secure and extremely professionals are developing applications. We guide to implement mobile app development and SOA hybrid applications.Code in Nodejs, Angular,Ionic,ReactJS and Yiiframework.

    ReplyDelete

Selenium4: Working with two parallel windows in Selenium Automation

A new method newWindow() is introduced in Selenium 4 (Alpha). Using this method we can open a new tab or new window from the current window...