Guest User

Untitled

a guest
Apr 20th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. val auth_test =
  2. exec(http("Login")
  3. .post("/").headers(header_0)
  4. .basicAuth("""email""", """pass""")
  5. // .formParam("email", "email")
  6. // .formParam("pass", "pass")
  7. // .formParam("", "Connexion")
  8. .check(status.is(200),currentLocation.is("https://www.facebook.com/"))
  9. ).pause(2)
  10.  
  11. //doesn't work
  12. val auth_friend_Zone =
  13. exec(http("Friend_spaces").get("/profil").headers(header_0)
  14. .check(css("table.uiGrid._51mz tbody tr td div a", "href").findAll
  15. .saveAs("url_Friend"))
  16. .check(status.not(404), status.is(200), status.not(500)))
  17. .exec((session: Session) => {
  18. val urlFriends = session("url_Friend")
  19. .as[Seq[String]]
  20. val rnd_ex = randomPage.nextInt(urlFriends.length)
  21. session.set("randomFriendUrl", urlFriends(rnd_ex))
  22. })
  23. .exec(http("${randomFriendUrl}").get("${randomFriendUrl}"))
  24. .pause(2)
  25. val auth = scenario("Authentification").exec(
  26. auth_test,
  27. auth_friend_Zone
  28.  
  29. // auth_profil_test
  30. )
  31. setUp(auth.inject(atOnceUsers(5))).protocols(httpConf)
  32. .assertions(
  33. global.responseTime.max.lt(1000),
  34. global.successfulRequests.percent.gt(97))
  35. }
Add Comment
Please, Sign In to add comment