We introduce new methodologies for black box testing of a switching box that complies with P4Runtime, gNMI, and gNOI APIs. We explain how to automate generation of the so called test vectors (TVs) as well as test code to be able to test all the expectations and API corner cases. We also provide multiple examples of TVs and the generated code and demonstrate how the framework can test complex scenarios. The proposed test framework will become available as part of Stratum code base.