The "Testament of Solomon" is an Old Testament pseudepigraphical work, purportedly written by King Solomon, in which Solomon mostly describes particular demons whom he enslaved to help build the temple, the questions he put to them about their deeds and how they could be thwarted, and their answers, which provide a kind of self-help manual against demonic activity. The author is obviously a Christian. The date of the text is uncertain, perhaps 1st century to 3rd century; regardless, it is certainly the oldest surviving work that is particularly concerned with individual demons.
When a demon named Ornias harasses a young lad (who is favorite of Solomon) by stealing half his pay and sucking out his vitality through the lad's thumb, Solomon prays in the temple and receives from the archangel Michael a ring with a seal on it which will enable him to command the demons (c.f. Seal of Solomon). Solomon lends the ring to the lad who by throwing the ring at the demon Ornias stamps him with the seal and brings him under control. Then Solomon orders the demon Ornias to take the ring and similarly imprint the prince of demons who is Beelzeboul/Beelzebul.
With Beelzebul under his command Solomon now has the entire race of demons at his bidding to build the temple. Beelzebul reveals he was formerly the highest ranking angel and so equates to Satan, a name that does not appear in this work.
Most of the rest of the work contains Solomon's interviews with the demons, some of whom are quite grotesque, including one in the shape of a dog and another who has no head and sees through its breasts. Two demons associated strongly with sexuality appear amongst them - Asmodeus from the Book of Tobit, and a female demon named Obyzouth, identical to Lilith in all but name, including the strangling of newborn children. But most of the other demons are otherwise unknown by name from other works even though this does not seem to be new lore but a bundling of various bits of demon-lore from mixed sources.
Some of the demons mention their personal opponent in terms that indicate a future Christ, and, together with its late dating - 100-400 AD - this is one of the reasons that scholars consider it to have been written under Christian influence.
In Chapter 18 the demons of the 36 decans appear with names that sometimes seem to be conscious distortions of the traditional names for the decans and claim responsibility mostly for various ailments and pains. They provide the magical formulae by which they may be banished. For example, the thirty-third demon is Rhyx Phtheneoth who causes sore throat and tonsilitis and can be driven off by writing the word Leikourgos on ivy leaves and heaping them into a pile.
Solomon's final demon encounter involves sending a servant boy with his ring to take captive a wind demon who is harassing the land of Arabia. The boy is to hold a wineskin against the wind with the ring in front of it, and then tie up the bag when it is full. The boy succeeds in his task and returns with the wineskin. The imprisoned demon calls himself Ephippas and it is by his power that a corner stone, rejected as too large, is raised into the entrance of the temple, which purportedly explains Psalm 118.22:
The stone that the builders rejected
has become the head stone of the corner.
This is Yahweh's doing;
it is wonderful in our eyes.
Then Ephippas and another demon from the Red Sea bring a miraculous column made of something purple (translation obscure) from out of the Red Sea. This Red Sea demon reveals himself as Amelouith who claimed to be the demon who supported the Egyptian magicians against Moses and who hardened Pharaoh's heart but had been caught with the Egyptian host when the sea returned and held down by this pillar until Ephippas came and together they could lift it.
There follows a short conclusion in which Solomon describes how he fell in love with a Shunammite woman and agreed to worship Rephan and Moloch (from Acts 7.43, itself quoted from Amos 5.26). Solomon agrees to sacrifice to them, but only sacrifices the blood of locusts considering that to be nothing. But the spirit of God departs from him.
Despite the positive/neutral presentation she is given in the Bible, the Testament of Solomon presents the Queen of Sheba as a witch, indicating that the author had an awareness of Jewish tradition, which had argued the same.
(Wikipedia http://en.wikipedia.org/wiki/Testament_of_Solomon)