In reply to rakesh2learn:
As build_phase() is top-down, test creates object on env_h but env build_phase is not yet executed and you don’t have object created on ahb_agent handle.
Move same code to connect_phase() or any other phase after build_phase().
But in above case also you should get error for “NULL handle dereference”. Check if handle name for ahb_agent is correct.