Hi,
I have a problem that make me crazy. I’m writing a funcion to update a teststep after editing. I use DelayStep as example. I change time from default 0,1 to 3 then serialize all parameters with a json string to my function (json is necessary for the web transmission).
Then deserialize to a dictionary key, value; select the step in testplan by GuiId and then update all values.
Finally I call annotations?.Write()
If I recall the step (last row) no modification found.
Where I’m wrong?
Thanks in advance for help.
Ralph
public void UpdateStep(string json_step)
{
var dict = (Dictionary<string, object>)JsonConvert.DeserializeObject(json_step, typeof(Dictionary<string,object>));
var id = dict["GuiId"].ToString();
var step = testPlan.Steps.GetStep(Guid.Parse(id));
var annotations = AnnotationCollection.Annotate(step);
var members = annotations?.Get<IMembersAnnotation>()?.Members?.ToList();
foreach (var x in members)
{
var name = x.Get<IDisplayAnnotation>().Name.ToString();
try
{
var value = dict[name];
x.Get<IObjectValueAnnotation>().Value = value;
}
catch (Exception ex)
{
}
}
annotations?.Write();
step = testPlan.Steps.GetStep(Guid.Parse(id));
//guiUserInterface.queryIsRunning = false;
}