Reputation: 13
I didn't get to know how to set the browser capabilities in watir, so got this online and tried the following but it didn't work for me.
My problem is, i was suppose to reduce the zoom level to 75% and do the rest of the coding:
driver = Watir::Browser.new :chrome
driver.send_keys [:control, :subtract]*3
Upvotes: 0
Views: 546
Reputation: 6064
It's common notion that when people use selenium,they tend to use driver
variable, but when people use WATIR they use browser
, so use browser instead of driver.
And to answer your question, you can use the following code to set up your zoom level.
browser=Watir::Browser.new :chrome
browser.execute_script("document.body.style.zoom='75%'")
Upvotes: 1