python - How to set zoomFactor in selenium + phantomjs? -


phantomjs version: 1.9.7
selenium version: 2.40.0

setting zoomfactor works when directly call phamtomjs page.zoomfactor set in .js file:

works well

var page = require('webpage').create();     page.open('http://google.com', function () {     page.zoomfactor = 0.25;     page.render('test.png')     phantom.exit(); }); 

however doesn't work when set in desired_capabilities in selenium:

does not work

desiredcapabilities.phantomjs['phantomjs.page.zoomfactor'] = 0.25 driver = selenium.webdriver.phantomjs() driver.get('http://google.com') driver.save_screenshot('test.png') driver.quit() 

i tried this, doesn't work either:

driver = selenium.webdriver.phantomjs(     desired_capabilities={'phantomjs.page.zoomfactor': 0.25} ) 

what doing wrong?


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -