Multiple KeyCheck?

Good evening, I ran into a problem that I need to check all SOURCEs from past HTTPREQUESTs, but I can’t do it, now I’ll try to explain with screenshots:

I tried to do it via:

data.SOURCE[“HttpRequest1”]
data.SOURCE(HttpRequest1)
data.SOURCE(“HttpRequest1”)
data.SOURCE{*}

But it doesn’t work

Thank you for your attention and I will be very glad if you help me with this!

ps. I know it can be done like this but in that case I can’t properly implement “Faiture” so I think for me only the first option will do when I can “Keycheck” all the code from all requests

create a constant string after the request block with the value of data.SOURCE

BLOCK:ConstantString
  value = @data.SOURCE
  => VAR @SOURCE1
ENDBLOCK

Like that

after that just pass the var of the constant string in the keycheck

1 Like

Thanks for the response, The same thing can happen if you parse the entire code of the site, unfortunately this slows down the speed of work when checking so many requests at once, it will load and for the fact that it parses the code again, do you know another faster way?

Hello @Euclid

Here is how to proceed I will explain to you create a list then at each end of the request you add the source to it in our case the source is written like this data.SOURCE

I chose 3 books each on a different page :

A Light in the Attic exclusive to page 1
In Her Wake exclusive to page 2
When We Collided exclusive to page 3

List<String> BigBurger = new List<String>();


BLOCK:HttpRequest
  url = "https://books.toscrape.com/"
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK

BigBurger.Add(data.SOURCE);


BLOCK:HttpRequest
  url = "https://books.toscrape.com/catalogue/page-2.html"
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK

BigBurger.Add(data.SOURCE);

BLOCK:HttpRequest
  url = "https://books.toscrape.com/catalogue/page-3.html"
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK
BigBurger.Add(data.SOURCE);


BLOCK:Keycheck
  banIfNoMatch = False
  KEYCHAIN SUCCESS OR
    STRINGKEY @BigBurger Contains "A Light in the Attic"
  KEYCHAIN FAIL OR
    STRINGKEY @BigBurger Contains ""
ENDBLOCK

Let’s try with the first title "Light in the … "

This is a key from page one but as you can see it was not overwritten by the other sources because I added it to a list

Second title In Her Wake :


It also works

Third title When We Collided :


It also works

As you can see we have split the 3 sources to make one.
And if i try with a title of the fourth page :
Capture
As you can see it’s not working

Hope that answered your question

Wannacry

2 Likes

Thanks for your help, wish you good luck!