The Testament of Solomon is considered part of the pseudepigrapha–it is an ancient text written around the time parts of the Hebrew Bible were written, but it was not included in the Jewish biblical canon. Its opening line, “The testament of Solomon, son of David, who was king in Jerusalem” is almost exactly the start of Ecclesiastes (which is included in the Hebrew Bible): “The words of Kohelet, son of David, king in Jerusalem.” The Testament finishes that sentence, however, in a completely different way: “…who mastered and controlled all spirits of the air, and used angels to bring demons to naught.”
In the Testament, Solomon is portrayed as a cross between a detective and a sorcerer. Driven by his Divinely-given wisdom, he relates stories of exorcisms and battles with demons. The text has the feel of a handbook, complete with recipes and amulets for protecting against demons and purging them.
Is it possible this document was legitimately written or inspired by Solomon? Most historians doubt it–the oldest versions of the Testament are written in Greek, and scholars have identified both Jewish and Christian influence in its stories. More likely, it was written between the first and fifth centuries, and it was preserved to the present day–not necessarily for its merits as a demon-hunting manual, but as a fascinating compendium of stories.