說我有一個清單:
contacts: []
現在,我想通過 Robot Framework 關鍵字將字典添加到此串列中。這Key本字典的 是email_address,它的值作為引數傳遞。這是關鍵字:
Test keyword
[Arguments] ${email} #[email protected]
Append to list ${contacts} {"email_address":"$email"}
但這不起作用。我希望最終的結果是這樣的:
contacts: [{"email_address":"[email protected]"}]
我怎樣才能做到這一點?
uj5u.com熱心網友回復:
您必須先創建字典:
Test keyword
[Arguments] ${email} #[email protected]
&{dictionary}= Create Dictionary email_address=${email}
Append to list ${contacts} ${dictionary}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/398312.html
下一篇:如何使用子串列重塑串列?
