A common question is how to check whether an object exists in a scene. One simple way to check this is using the WaitForObject command, such as:

api.WaitForObject("//*[@name='StartButton']");

Alternatively, if you want to trigger an event and check whether the "active" property has been set to "true" for a specific object, you can check using the GetObjectFieldValue command, such as in the example below. 

// This comment sets the object active in the scene
bool hiddenCube = api.CallMethod("//*[@name='HiddenCube']", "SetActive", new object[] { true });

// This command checks that the object is active
bool invisCube = api.GetObjectFieldValue<bool>("//*[@name='HiddenCube']/@active");

// Test the outcome
Assert.IsTrue(invisCube == true, "The invisible cube is still missing");