If this is a new problem for your pet, contact your veterinarian to be sure that a medical disorder is not the reason that your pet has eliminated while you were gone. If all is well, be sure that you see your dog eliminate before you leave the house. Many pet owners have the habit of putting the dog outside to do their business but not watching them to ensure they do indeed relieve themselves and then let them back inside when they are at the door. Another important recommendation is to get your dog used to eliminating before the walk begins so that you can make the walk shorter if you are in a hurry.
While barking was a common sign exhibited by dogs with separation anxiety, many dogs also eliminated indoors. The elimination usually occurred within 20 minutes after the last person left the house, even if the dog had just been outside and may be in the vicinity of the exit door. Many dogs both vocalized and eliminated indoors when left alone. For some dogs, it did not matter how long they were alone, or the last time they were outdoors, they eliminated inside no matter what. A video will help establish if this is anxiety-based behavior. Additionally, make sure you search the house daily for any other elimination. If you find elimination both when you are home and when you are gone, you may have a problem with house training and the issue may not be related to anxiety.