Tuesday 29 April 2014

Client Interview Question in Load runner

1. How do you gather project requirements?
   
   Answer: We gather project requirements through meetings with stakeholders, reviewing project documentation, and analyzing existing systems or applications.

2. What are the differences between running Vusers as a process and as a thread?
   
   Answer: Running Vusers as a process creates separate instances for each user, while running as a thread shares resources among users. Threads are preferred for scalability.

3. Which functions are commonly used in performance testing scripting?
   
   Answer: Common functions include those for simulating user actions, capturing dynamic values, verifying responses, and managing test flow.

4. What is the workflow process of performance testing?
   
   Answer: The workflow involves planning, script development, test execution, monitoring, analyzing results, and reporting findings.

5. Have you used LoadRunner's Controller module?
   
   Answer: Yes, we use LoadRunner's Controller module to manage and execute performance tests, control Vusers, and monitor system resources.

6. How do you design a scenario in LoadRunner's Controller?
   
   Answer: We design scenarios by defining virtual users, specifying scripts, setting load distribution, configuring runtime settings, and scheduling test execution.

7. Have you written custom functions in your performance testing scripts?
   
   Answer: Yes, we've written custom functions to handle complex scenarios, manipulate data, and enhance script functionality.

8. What bottlenecks have you identified in your performance testing projects?
   
   Answer: Bottlenecks include server overloads, network congestion, database issues, inefficient code, and resource limitations.

9. Have you used LoadRunner's goal-oriented scenario feature?
   
   Answer: Yes, we use goal-oriented scenarios to define performance goals, such as transaction response times or throughput, and let LoadRunner adjust the load to meet these goals.

10. Explain your project's end-to-end performance testing process.
   
    Answer: Our end-to-end process includes requirement analysis, script development, scenario design, test execution, result analysis, bottleneck resolution, and reporting.

11. Describe your experience in previous performance testing projects.
    
    Answer: In previous projects, we've conducted load, stress, and endurance testing for various applications, identifying performance issues and optimizing system performance.

12. On a scale of 1 to 10, how do you rate your proficiency in LoadRunner?
    
    Answer: I would rate myself as an 8 in LoadRunner proficiency, with extensive experience in script development, scenario design, and result analysis.

13. What is a protocol in performance testing?
    
    Answer: A protocol defines the communication rules between client and server applications, specifying how data is exchanged during performance testing.

14. What is a memory leak?
    
    Answer: A memory leak occurs when a program fails to release memory it no longer needs, leading to gradual depletion of available memory resources.

15. Define heap usage in performance testing.
    
    Answer: Heap usage refers to the amount of memory allocated for dynamic memory allocation during program execution, impacting overall system performance.

16. How many users have you simulated in your previous performance tests?
    
    Answer: In previous tests, we've simulated hundreds to thousands of virtual users to assess system scalability and performance under load.

17. What bottlenecks did you identify in your current project?
    
    Answer: Critical bottlenecks in our current project include database contention, server CPU utilization spikes, and slow third-party API responses.

18. What recommendations have you provided to clients or stakeholders based on performance test results?
    
    Answer: Recommendations include infrastructure upgrades, code optimizations, caching strategies, database indexing, and load balancing configurations.

19. What protocols have you worked with in your past experiences?
    
    Answer: We've worked with protocols such as HTTP/HTTPS, Web Services, Citrix, Oracle NCA, SAP GUI, and others in various performance testing projects.

20. How do you handle heartbeat settings in LoadRunner?
    
    Answer: We configure heartbeat settings to maintain communication between LoadRunner components and ensure accurate test execution and monitoring.

21. How do you manage work within your performance testing team?
    
    Answer: We collaborate closely with team members, assign tasks based on expertise, communicate effectively, track progress, and address any challenges promptly.

22. Explain how you would test 10 URLs simultaneously in LoadRunner.
    
    Answer: We create separate scripts for each URL, configure scenarios with appropriate load distribution, and execute tests concurrently using LoadRunner's Controller.

23. Have you implemented custom functions in your performance testing scripts?
    
    Answer: Yes, we've implemented custom functions to handle authentication, data manipulation, dynamic correlations, and other specialized tasks.

24. What is your approach when system memory reaches 100% during performance testing?
    
    Answer: We investigate memory usage patterns, identify memory-intensive processes, optimize memory allocation, and consider hardware upgrades if necessary.

25. What reports and documents do you prepare after completing performance tests?
    
    Answer: We prepare performance test reports detailing test objectives, methodologies, results analysis, identified issues, recommendations, and action plans.

26. What are the server requirements for installing LoadRunner?
    
    Answer: Server requirements include sufficient CPU, memory, and disk space to run LoadRunner components, along with network connectivity and appropriate user permissions.

27. What analysis techniques do you use to interpret performance test results?
    
    Answer: We use techniques such as response time analysis, throughput calculation, error rate assessment, bottleneck identification, and comparison with performance goals.

28. Describe your involvement in previous performance testing projects.
    
    Answer: In previous projects, we've been involved in requirement gathering, script development, scenario design, test execution, result analysis, and performance optimization.

29. What challenges have you encountered while scripting performance tests?
    
    Answer: Challenges include dynamic correlations, script parameterization, handling asynchronous requests, simulating realistic user behavior, and troubleshooting script errors.

30. What is the significance of LoadRunner's web_reg_save_param function?
    
    Answer: The web_reg_save_param function captures dynamic values from server responses, allowing us to correlate data and maintain session state during performance testing.

Sunday 13 April 2014

Error: "License cannot be save in your installation directory. (Error code = -4) It will be used only for this session."

Solution:
Make sure that you have administrator privilege to the Controller. If you are accessing the Controller via the network, make sure that you have write access to the network.

Error “License security violation. Operation is not allowed”

Solution:
If you are applying “TEMPORARY” license, it will not work if LoadRunner was previously installed with a “TEMPORARY” or valid license key. You need to contact HP Customer Support for a valid license key.

Error “License key was generated with a version superior to your license manager. Upgrade your license manager”

Solution:
Make sure the HostID that was sent to HP Customer Support was generated from the correct LoadRunner version. If you sent the HostID of LoadRunner 7.6, but apply the license key on LoadRunner7.0 install, you will get this problem.

Error: “Cannot install license information, probably access to system resource was denied”

Solution:
This error indicates that you need to log in with local administrator permission, since you installed the product with administrator permission. If you still get the error after login as local administrator, run setlicensepermissions.exe from the \bin directory to change the registry permissions

Error: “License manager does not support objects of this type or license is invalid”

Verify the followings:
Check the properties of the license key. If you apply a license key that has components that does not come with that version of LoadRunner, you will get this error.
Example:Apply WAN emulation license (introduced in LoadRunner 7.6), or J2EE diagnostics (Introduced in LoadRunner 7.8 FP1) license on LoadRunner 7.5
Make sure that you are applying the license key on a machine where the license is generated for. In LoadRunner7.x, license keys are host lock. If you try to apply the license key on a separate machine, you will get this error.

How do I identify the SSL protocols and certificates used by a website when testing with LoadRunner

To identify the SSL protocols and certificates used by a website in OpenSSL and LoadRunner, you can follow these steps:

1. Launch OpenSSL in the command prompt or terminal. Make sure you have OpenSSL installed on your machine.

2. Connect to the website using OpenSSL by running the following command:

openssl s_client -connect <website>:<port>

Replace `<website>` with the actual website URL and `<port>` with the appropriate port (usually 443 for HTTPS).

3. OpenSSL will establish a connection with the website and display information about the SSL certificate, protocols, and other details. Look for the following information:

- Certificate issuer: This indicates the entity that issued the SSL certificate.
- Certificate subject: This represents the website's information that the certificate is issued for.
- Validity dates: Check the "Not Before" and "Not After" dates to determine the certificate's validity period.
- SSL/TLS version: Look for the "SSL-Protocol" or "TLS-Protocol" field to identify the SSL/TLS version being used.

4. Analyze the output to identify the SSL protocols and certificates used. It may include information about the certificate chain, intermediate certificates, and the root certificate authority (CA).

Regarding LoadRunner, you can use the web_custom_request function to retrieve SSL-related information.

Sample Code:

int result;
result = web_custom_request("SSL_Info",
"URL=https://easyloadrunner.blogspot.com/",
"Method=HEAD",
LAST);


 The web_custom_request function will send a HEAD request and capture the SSL-related information in the LoadRunner output. LoadRunner supports various protocols and extensions, including HTTPS/SSL. Ensure that you have the appropriate SSL-related modules or add-ins installed and configured in LoadRunner to enable SSL/TLS analysis.

How do I generate a HostID for a LoadRunner license in load runner

For LoadRunner7.0 – 7.8 Feature Pack1:a. Bring up the Controller and go to Help - About LoadRunner
b. Click on ‘License Info…’ and you will see the ‘Host ID’ on the screen.


For LoadRunner8.0:a. Go to Start - Programs - LoadRunner - LoadRunner
b. Click on the ‘License’ menu and you will see the ‘Host ID’ on the screen.

Note: If for some reason you are not able to get to this screen, you can run licidgenerator.exe in \bin directory to generate Host-id

How do I add a new License key in load runner?

For LoadRunner7.0 – 7.8 Feature Pack1:1. Bring up the Controller and go to Help - About LoadRunner.
2. Click on "New License" and type in the new license key.
3. Click .
4. Close the Controller and restart it; the new license key will be in effect.

For LoadRunner 8.0:1. Close the Controller
2. Go to Start - Programs - LoadRunner - LoadRunner
3. Click on the ‘License’ menu
4. Click on ‘New License’ and type in the new license key
5. Click , and to close the window
6. Bring up the Controller again.

How to verify the Vusers or Monitors that are currently licensed in load runner

How to verify license related information like Expiration dates, monitors purchased, and the number and type of Vusers.

For LoadRunner7.0 – 7.8 Feature Pack1:
a. Bring up the Controller and go to Help - About LoadRunner
b. Click on ‘License Info…’ and you will see the License Information.


For LoadRunner8.0:
a. Go to Start - Programs - LoadRunner - LoadRunner
b. Click on the ‘License’ menu and you will see the ‘Host ID’ on the screen.

Bugzilla interview questions?

What is Bugzilla?Bugzilla is a bug tracking system developed at mozilla.org.

How do enter a bug in Bugzilla?To enter a bug, through "Enter a new bug" link from the main Bugzilla page. This will take you to a product selection screen.

What happens once enter a bug?After you enter a bug, mail is sent both to you and the QA department. A member of the QA department will verify that they can reproduce your bug.

How do search a bug?To search a bug, through "Query" link from the main Bugzilla page.
How do submit a patch?The new Bugzilla system supports the attachment of patches, test cases, and various other forms of file types directly from the bug report screen. Just click on "Create an attachment"

Are cookies required in Bugzilla?Yes.

How can you view your assigned bugs?We can view the assigned bugs though “My Bugs” link.

How can you generate bug report?We can generate bug report through “Report” link.

When Bugzilla was released?Bugzilla was released in 1998.

Which language was written Bugzilla first time?Bugzilla was originally written in "TCL".

Who developed the Bugzilla?Terry Weissman

Which language Bugzilla written?"Perl"

What are the Bugzilla fields?Bugzilla have 11 fields like-
(1)Product
(2)Component
(3)Version
(4)Platform
(5)OS
(6)Priority
(7)Severity
(8)Assigned To
(9)URL
(10)Summary
(11)Description
How can you edit your account in Bugzilla?We can use "User Preferences" link.

How can you add new Product in Bugzilla?We can use "Product" link for adding new product.

How can you add Components of product in Bugzilla?We can use "Components" link for adding components in Bugzilla.

How can edit version of any product in Bugzilla?We can use "Edit Versions" link.

"Memory violation error "in Load Runner

Reasons for this:
  1. C pointer errors,C programming invalid declarations
  2. Memory full
  3. Not enough Memory for what you need to place in a defined space
  4. Memory not yet allocated before attempting to use it
  5. Memory allocated but not deallocated
  6. Trying to copy a non pointer version of a datatype to a pointer defined version of a datatype, such as copying a character array to a pointer to a character array
  7. Generally unless you have a hardware issue this is a developer error

Friday 11 April 2014

Sample date conversion program using vugen scripting in Load runner

//Main Function
Action()
{
char *ConvDate;

//Call date conversion function
dateConv("10/JUL/2009", ConvDate);
lr_output_message("date is %s",ConvDate);
return 0;
}

//Date conversion function
dateConv(char *MyDate, char *ReqDate)
{
lr_save_var(MyDate,2,0,"Date");
lr_save_var(MyDate+3,3,0,"pMonth");

lr_output_message("Month is %s",lr_eval_string("{pMonth}"));

if(strcmp(lr_eval_string("{pMonth}"),"JAN")==0)
lr_save_string("01","Month");

/*  Similar rest of the code goes here....*/

else if(strcmp(lr_eval_string("{pMonth}"),"DEC")==0)
lr_save_string("12","Month");

lr_save_var(MyDate+7,4,0,"Year");

ReqDate = lr_eval_string("{Month}/{Date}/{Year}");
lr_output_message("date is %s",ReqDate);

return 0;
}

Invoke Vugen from a .net app

Steps for running Vugen from a .NET application:

1. Add System as a Reference to the project
2. Here is actual code to run the script -
Shell("[Vugen Installation Folder]\bin\mmdrv.exe -usr [Full path of the script] -vugen_win 0", AppWinStyle.NormalFocus)

Example :

Shell("C:\Program Files\HP\Virtual User Generator\bin\mmdrv.exe -usr C:\FlightsTool\FlightCal.usr -vugen_win 0", AppWinStyle.NormalFocus)
Note: Neither Vugen now the Run Time window will be visible as the script runs in the background, however the results, log files, etc will be still be saved in the usual location.

lr_param_sprintf security issue when run over a firewall(Error: CCI security error: You are running under secure mode and the function lr_param_sprintf is not allowed in this mode. )

The function lr_param_sprintf sometimes causes a security issue in the script when run from Performance Center.

Error Message
Error: CCI security error: You are running under secure mode and the function lr_param_sprintf is not allowed in this mode.

This function causes an issue in Performance Center due to the way the function works and the way the Load Generators have been setup in the environment as this function does not work over a firewall.
Solution:This is an example of how function could be to generate a timestamp value –

lr_param_sprintf( "timeStamp" , "%ld", time(&t) );
An easier and workable way of which is

char strTime[10]; //timestamp variable
/*
-- -- -- -- -- -- -- --
Other code goes here
-- -- -- -- -- -- -- --
*/
lr_save_string( (char*)itoa( time(&t), strTime, 10 ), "timeStamp" );

Run Vugen from command prompt in load runner

Run Vugen from command prompt

Here is the command to run vugen from the command prompt

1. Go to where the Vugen is installed and navigate to the 'bin' folder
C:\Program Files\HP\Virtual User Generator\bin

2. Run the following command there
mmdrv.exe -usr [Full path of the script name.usr]

Thursday 10 April 2014

What is Junit Test Framework?

JUnit is a Regression Testing Framework used by developers to implement unit testing in Java and accelerate programming speed and increase the quality of code. JUnit Framework can be easily integrated with either of the followings:

1.Eclipse
2.Ant
3.Maven
Features:JUnit test framework provides following important features
  1. Fixtures
  2. Test suites
  3. Test runners
  4. JUnit classes
  5. Fixtures
Fixtures is a fixed state of a set of objects used as a baseline for running tests. The purpose of a test fixture is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. It includes

setUp() method which runs before every test invocation.

tearDown() method which runs after every test method.

Let's check one example:import junit.framework.*; public class JavaTest extends TestCase { protected int value1, value2; // assigning the values protected void setUp(){ value1=3; value2=3; } // test method to add two values public void testAdd(){ double result= value1 + value2; assertTrue(result == 6); } }

Test suite:

Test suite means bundle a few unit test cases and run it together. In JUnit, both @RunWith and @Suite annotation are used to run the suite test. Here is an example which uses TestJunit1 & TestJunit2 test classes.import org.junit.runner.RunWith; import org.junit.runners.Suite; //JUnit Suite Test @RunWith(Suite.class) @Suite.SuiteClasses({ TestJunit1.class ,TestJunit2.class }) public class JunitTestSuite { }
import org.junit.Test; import org.junit.Ignore; import static org.junit.Assert.assertEquals; public class TestJunit1 { String message = "Robert"; MessageUtil messageUtil = new MessageUtil(message); @Test public void testPrintMessage() { System.out.println("Inside testPrintMessage()"); assertEquals(message, messageUtil.printMessage()); } }
import org.junit.Test; import org.junit.Ignore; import static org.junit.Assert.assertEquals; public class TestJunit2 { String message = "Robert"; MessageUtil messageUtil = new MessageUtil(message); @Test public void testSalutationMessage() { System.out.println("Inside testSalutationMessage()"); message = "Hi!" + "Robert"; assertEquals(message,messageUtil.salutationMessage()); } }

Test runner:

Test runner is used for executing the test cases. Here is an example which assumes TestJunit test class already exists.import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.Failure; public class TestRunner { public static void main(String[] args) { Result result = JUnitCore.runClasses(TestJunit.class); for (Failure failure : result.getFailures()) { System.out.println(failure.toString()); } System.out.println(result.wasSuccessful()); } }

JUnit classes:

JUnit classes are important classes which is used in writing and testing JUnits. Some of the important classes are

Assert which contain a set of assert methods.

TestCase which contain a test case defines the fixture to run multiple tests.

TestResult which contain methods to collect the results of executing a test case