Sono in javascript + mocha + nodo terra.Come modificare l'agente utente di selenio in selenium-webdriver nodejs land?
Ho provato a fissare userAgent e 'user-agent' come tasti sulle capacità:
var webdriver = require('selenium-webdriver');
var ua = 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X)';
var driver = new webdriver.Builder().
...
withCapabilities({ 'browserName': 'firefox',
userAgent: ua,
'user-agent': ua,
}).
build();
C'è this answer che dice di usare un profilo di Firefox, ma non è esposto. Non v'è alcun driver.FirefoxProfile
né uno esposto a livello globale né webdriver.FirefoxProfile
né driver.profiles
ecc
Ho provato Googling e guardando the source e the documentation ma non c'è nulla su questo.
mi sono imbattuto in un problema in cui un server ASP.net sarebbe tornato rotto JavaScript con il PhantomJS di default user-agent, quindi devo falsificare così ottengo una pagina corretta. Vedi anche https://stackoverflow.com/questions/20164753/sys-webforms-pagerequestmanager-is-undefined-error-in-ie11-working-fine-in-ie10 – Luksurious