Проблема решена.
[codebox]ElggContent()
{
int p;
char pageurl[64];
// Save {text} parameter
lr_save_string(mytext, "text");
// Get page_rand parameter
p=atoi(lr_eval_string("{page_rand}"));
// Paste URL together
sprintf(pageurl, "%spg/pages/view/%d", site, p);
lr_output_message("URL is %s", pageurl);
// Save {URL} parameter
lr_save_string(pageurl, "URL");
// Open URL
web_url("ELGG Page",
"URL={URL}",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=",
"Mode=HTML",
EXTRARES,
"Url=/elgg/mod/theme_simplebluewhite/graphics/theme_pageback.gif", ENDITEM,
"Url=/elgg/mod/theme_simplebluewhite/graphics/theme_contentback.gif", ENDITEM,
"Url=/elgg/mod/theme_simplebluewhite/graphics/theme_footer.gif", ENDITEM,
"Url=/elgg/_graphics/icon_rss.gif", ENDITEM,
"Url=/elgg/_graphics/icon_gallery.gif", ENDITEM,
LAST);
// Check Text
web_find("ELGG Text Check",
"expect=found",
"matchcase=yes",
"onfailure=abort",
"report=failure",
"repeat=no",
"what={text}",
LAST);
return 0;
}[/codebox]
[codebox]vuser_end()
{
int think;
// Random think time
think=atoi(lr_eval_string("{time_rand}"));
lr_output_message("Think time is %d sec.", think);
// Thinking....
lr_think_time(think);
return 0;
}[/codebox]
globals.h
[codebox]//--------------------------------------------------------------------
// Include Files
#include "lrun.h"
#include "web_api.h"
#include "lrw_custom_body.h"
#define n 18200
// Site
char *site="http://62.244.5.146:2280/elgg/";
// Text to check on every page
char *mytext="Powered by Elgg, the leading open source social networking platform";
// Random Think time Function
int fRandInteger(minInt, maxInt, id)
{
int rndInt, offset;
//srand is called before rand
srand(time(NULL));
if (maxInt == 0)
return maxInt; // Caller must handle a 0 in order to prevent error.
offset = minInt;
rndInt = (((minInt) + rand() % (maxInt - offset + 1)));
return rndInt;
}[/codebox]
- Форум тестировщиков
- → Просмотр профиля: Сообщения: Estrella