Originally posted by tvklovesu on January 19, 2023
Hello,
I have the following code to set my browser capabilities. I would like to add Zoom in to set the browser to 100%. The reason I ask is when I run in my local some objects are working fine, but in my selenium grid the page zoom is set to 60% or so. And my tests are failing. I am think that could be because of this zoom setting.
Originally posted by rraghvani on January 20, 2023
The following code will adjust the page size,
function pagesize()
{
var page = Sys.Browser("chrome").Page("*");
var scope = page.contentDocument.Script.eval("document.body.style.transform='scale(0.8, 0.8)'");
}
Originally posted by tvklovesu on January 20, 2023
It’s not working for me. When that script ran, only the top banner of the page is displayed with zoomed in and the remaining part of the page content got blanked out like this, even if I do refresh then it goes back to its original zoom level.
Originally posted by tvklovesu on January 20, 2023
Thanks for your reference. For some reason it’s not working on my application. I tried on another site and it did worked as you mentioned. Is the document.style wrong that I am using. How do I find which style will change the screen size?