我有下面的.json文件,我只想根据用户输入更改down和up值。
"android": {
"appium:autoAcceptAlerts": true,
"appium:automationName": "UiAutomator2",
"appium:newCommandTimeout": 180,
"appium:appPackage": "com.android.settings",
"appium:platformName": "android",
"appium:capture.networkConfig": {
"shaping": {
"down":5,
"up": 2
}
}
},
上面的json主体我尝试使用下面的代码将“down”属性从“5”更改为“2”,将“up”属性从“2”更改为“1”。
if(state == 'high')
{
let tempVal = caps[platform]; // let platform = 'android'
console.log("**********************");
console.log(tempVal); // It's printing the json body.
for(let prep in tempVal)
{
tempVal[prep].shaping.down = 2; //Not replaced.
tempVa[prep].shaping.up = 1; //Not replaced.
console.log(tempVal[prep].shaping.down); // It's not printing down and returned as undefined.
}
console.log("**********************")
}
1条答案
按热度按时间btqmn9zl1#