You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
Router.json looks like
{
"sports.yahoo.com" : {
"headers" : [
{
"param" : "User-Agent",
"value" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5"
}
],
"newHost" : "sports.yahoo.com",
"record":true
}
}
-- Proxy controller
var util = require("util");
var log4js = require("yahoo-arrow").log4js;
var Controller = require("yahoo-arrow").controller;
function ProxyCustomController(testConfig,args,driver) {
Controller.call(this, testConfig,args,driver);
this.logger = log4js.getLogger("ProxyCustomController");
}
util.inherits(ProxyCustomController, Controller);
ProxyCustomController.prototype.execute = function(callback) {
var self = this;
self.resetProxyRecord(); // Reset the proxy record
if(self.driver.webdriver){
var page = self.testParams.page;
var webdriver = self.driver.webdriver;
webdriver.get(page);
webdriver.waitForElementPresent(webdriver.By.css("#yucs-search-submit")).then(function() {
var record = self.getProxyRecord(); // Get the proxy record
self.testParams.proxyManagerRecord=record;
self.driver.executeTest(self.testConfig, self.testParams, function(error, report) {
callback(error);
});
});
}else{
this.logger.fatal("Custom Controllers are currently only supported on Selenium Browsers");
callback("Custom Controllers are currently only supported on Selenium Browsers");
}
}
module.exports = ProxyCustomController;
Running this./node_modules/.bin/arrow proxy-descriptor.json --driver=selenium --browser=firefox --logLevel=debug will change the headers to Iphone
Change the newHost to ".yahoo.com". Run above command again.
The text was updated successfully, but these errors were encountered:
[
{
"settings": [ "master" ],
]
Router.json looks like
{
"sports.yahoo.com" : {
"headers" : [
{
"param" : "User-Agent",
"value" : "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5"
}
],
"newHost" : "sports.yahoo.com",
}
-- Proxy controller
var util = require("util");
var log4js = require("yahoo-arrow").log4js;
var Controller = require("yahoo-arrow").controller;
function ProxyCustomController(testConfig,args,driver) {
Controller.call(this, testConfig,args,driver);
this.logger = log4js.getLogger("ProxyCustomController");
}
util.inherits(ProxyCustomController, Controller);
ProxyCustomController.prototype.execute = function(callback) {
var self = this;
self.resetProxyRecord(); // Reset the proxy record
}
module.exports = ProxyCustomController;
Running this./node_modules/.bin/arrow proxy-descriptor.json --driver=selenium --browser=firefox --logLevel=debug will change the headers to Iphone
The text was updated successfully, but these errors were encountered: