Scoreboard sampling

I am sending multiple transactions and while comparing the actual and expected data my expected queue size is of 2 transactions and actual that of one which is giving me UVM_ERROR

What is your question? What is the error?

Instead of Queue, take an associative array with index as some ID which you can differentiate from each sequence item. Then compare the trans based on ID from expected and actual associative arrays!