Question

I am programming in C against a third party library (in HP/Mercury Loadrunner). I am trying to work out the code needed to dynamically call another function. See example below. Can someone assist with the code that will make this work?

HomePage() {
  // Load Runner code to conduct home page call
}

SearchResults() {
  // Load Runner code to conduct some search results call
}

**FunctionCall(char function[]) {
// Conduct a remote call to another function based on what was passed in???
function;
}**

Main() {

FunctionCall(HomePage);
FunctionCall(SearchResults);

}
Was it helpful?

Solution

if you are looking for pointer to functions:

FunctionCall(void(*function)(void))
{
    function();
}

Main()
{

    FunctionCall(HomePage);
    FunctionCall(SearchResults);

}

OTHER TIPS

OK, just for clarification..... Are you trying to (a) Use LoadRunner functions and components outside of use within LoadRunner or (b) Designing code which will be used inside of LoadRunner which uses your additional code?

One path will result in a success, the other not so.

This code is being used within loadrunner code and is working now based on the example.

What is your input?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top