In the House of Commons, after election, an MP must swear an Oath of Allegiance before taking his or her seat. Members who object to swearing an oath may make a Solemn Affirmation instead.
In the House of Lords the Oath of Allegiance must be taken, or Solemn Affirmation made, by every Lord on introduction and at the beginning of every new Parliament. This must be done before he or she can sit and vote in the House of Lords.
While holding a copy of the New Testament (or, in the case of a Jew or Muslim, the Old Testament or the Koran) a Member swears: "I...swear by Almighty God that I will be faithful and bear true allegiance to Her Majesty Queen Elizabeth, her heirs and successors, according to law. So help me God."
The text of the affirmation is: - "I...do solemnly, sincerely and truly declare and affirm that I will be faithful and bear true allegiance to Her Majesty Queen Elizabeth, her heirs and successors according to law".
Further information on this subject can be found from the following link.
About Parliament: Swearing In