Сделайте объект обновления с именами свойств, включая нужный путь. («somekey.» + из примера OP), а затем используйте это обновление.
//the modification that's requested
updateReq = {
param2 : "val2_new",
param3 : "val3_new"
}
//build a renamed version of the update request
var update = {};
for(var field in updateReq){
update["somekey."+field] = updateReq[field];
}
//apply the update without modifying fields not originally in the update
db.collection.update({._id:...},{$set:update},{upsert:true},function(err,result){...});
Думаю, я понял это. Тест проходил, когда блокнот запускался в скрытом окне. Я дал ему дополнительный аргумент, и он прошел:
*** Test Cases ***
AutoIT Notepad Test
Run notepad.exe ${EMPTY} 1
Wait for active window Untitled - Notepad
Send Typing some text
Если у вас есть блокнот в папке по умолчанию, попробуйте это:
*** Settings ***
Library AutoItLibrary
*** Variables ***
${notepad} C:\\Program Files\\Notepad\\notepad.exe
*** Test Cases ***
Run ${notepad}
Send This is some text