Hello dear... I have gone through your post in which you have mentioned that your 7-year-old son has had green poop, stomach pain and some nausea
for few weeks.
All these symptoms indicate that he may be having Gastroenteritis
In that regard his Pediatrician
has suggested correctly regarding the poop test.
The analysis of the poop will reveal the causative organism & appropriate antibiotics can be prescribed to your son.
And once the course of antibiotics is completed, he will be perfectly alright.
Make sure your son is eating a healthy diet & adequate hydration.
Avoid junk foods & also have a look if he is allergic to any particular food product.
I wish him a good health & speedy recovery.
Thanks & Take care.