Dmitri Tikhanski

Ranch Hand
+ Follow
since Oct 13, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
8
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dmitri Tikhanski

If you need to obtain the href attribute of the link with text Logout the relevant XPath query would be something like:



References:

  • XPath Syntax
  • Using the XPath Extractor in JMeter
  • XPath Examples

  • 2 years ago
    Cucumber does not know anything about databases testing, the implementation is up to you. The solution is to add a JDBC driver  for your database to your project CLASSPATH and develop the code which will check presence (or absence) of values in the database using Java SQL API.

    Pass/fail criteria could be set using Assert class of underlying xUnit library like JUnit or TestNG like:



    This will cause the relevant step and feature failures in case of mismatch.

    You might also want to reconsider your toolchain as there is a solution which supports both APIs and Databases testing: check out APIs testing
  • [url=https://en.wikipedia.org/wiki/Load_testing]Load testing of both tiers either separately or at the same time so you will be able to check your application performance

  • 2 years ago
    Your test structure is not valid, you should do exactly what real browsers are doing, to wit:

  • Open login page (HTTP GET request)
  • Extract _csrf_token dynamic parameter value using relevant JMeter Post-Processor and store it into a JMeter Variable
  • Perform login (HTTP POST request providing credentials and the JMeter Variable from the previous step as _csrf_token parameter value)


  • Check out How to Load Test CSRF-Protected Web Sites article for more information.

    Another option is using BlazeMeter Proxy Recorder, it is capable of exporting recorded scripts in SmartJMX mode, it assumes automatic detection and correlation of any dynamic parameters so you will not have to do this manually
    2 years ago
    I believe it is much better to rely on a build system which has automatic dependency management like Apache Maven rather than manually "download the parts I want".


    Here is how you can get latest Selenium client libraries into your project.



    Another option is compiling so called "uber" jar from the source code, it will allow avoiding any clashes with other libraries you might be using:




    See How to Run a Selenium Test with JUnit article for step-by-step instructions on setting up environment for Selenium tests development.
    2 years ago
    The idea of Pre and Post Processors is that they are executed before and after the Sampler, if there is no sampler - they will not be executed.

    If you want to execute a script and don't want it to reflect in test results I would suggest the following:
  • Add Test Action sampler to this tearDown Thread Group
  • Add Beanshell PreProcessor as a child of the Test Action sampler
  • Put your script inside the Beanshell PreProcessor



  • Test Action sampler doesn't generate any result so it seems to be what you're looking for.

    Also be aware that Beanshell isn't the best scripting option, it is recommended to use JSR223 Test Elements and Groovy language, check out Apache Groovy - Why and How You Should Use It article for more details.
    3 years ago
    I believe you should pass single string therefore you don't need the comma, modify your code to look like:



    and it should start working.



    I also recall I already recommended using JSR223 Elements instead of Beanshell.

    In general the good practice is to avoid scripting where possible, if you need to see the variable names/values you can use Debug Sampler and View Results Tree listener combination, see How to Debug your Apache JMeter Script guide for more details.

    3 years ago
    You can use[url=]JSR223 Test Elements[/url] to print the messages to console and/or jmeter.log file


    Be aware that there is vars shorthand for JMeterVariables class instance which provides read/write access to JMeter Variables.




    See Groovy is the New Black guide for more information
    3 years ago
    I believe you should put the Synchronizing Timer as a child of the request, you need to execute in paralle (see JMeter Scoping Rules for details)l. Also make sure your ramp-up period is lower than the Synchonizing Timer's "timeout", you need to have enough up-and-running users to synchronize. See Using the JMeter Synchronizing Timer article for more details.
    3 years ago
    If you look into the page source, you will see something like:


    The "value" might be different, but you need to pass this as a parameter along with credentials, so your test plan should look as follows:

  • Open https://portaltest.swps.edu.pl/ page (HTTP GET request)
  • Perform login (HTTP POST Request). You will need to provide "lt" input value from the previous step along with credentials


  • The process of extracting dynamic parameters from previous responses and adding them to the next request is called correlation and there is a plenty of material on it over the Internet.

    Another way of handling it in automated manner is using BlazeMeter Proxy Recorder (Mobile And Web), it is capable of exporting recorded scenarios in "SmartJMX" mode with automatic correlations applied so you should be able to record your scenario and it will be ready for replaying without any extra effort. See How to Cut Your JMeter Scripting Time by 80% article for more details.  
    3 years ago
    Maybe sample_variables property can help?

    1. Define something in "Variable Names" section of the JDBC Request, i.e. put session reference name there like:




    2. Add the next line to user.properties file (lives in Jmeter's "bin" folder)



    or alternatively pass it via -J command-line argument like:



    You need to use session_1 not session. As per JDBC Request Sampler documentation:

    If the Variable Names list is provided, then for each row returned by a Select statement, the variables are set up with the value of the corresponding column (if a variable name is provided), and the count of rows is also set up. For example, if the Select statement returns 2 rows of 3 columns, and the variable list is A,,C, then the following variables will be set up:

    A_#=2 (number of rows)

    A_1=column 1, row 1

    A_2=column 1, row 2

    C_#=2 (number of rows)

    C_1=column 3, row 1

    C_2=column 3, row 2



    So given your query returns only 1 row containing 1 integer - it will live in session_1 JMeter Variable. See Debugging JDBC Sampler Results in JMeter article for comprehensive information on working with database query results in JMeter.


    3. When test completes you'll see an extra column in .jtl results file holding your "session" value:

    4 years ago
    There is no "swiss-army-knife" solution which would work on all the websites. You can have i.e. one for Wordpress-based, one for Drupal-based, one for Magento, etc. but it isn't possible to have a predefined script which would do the testing. JMeter offers some Templates which speed up common tasks, but it isn't something you're looking for.

    The maximum you can do is simulating website "spidering", if this is you use case - you can consider HTML Link Parser test element.

    Also check Open Source Load Testing Tools: Which One Should You Use? article for the most viable alternatives to JMeter (none of them is capable of doing what you request, elsewise performance testers wouldn't exist)
    4 years ago
    Yes, it is possible as well.
    4 years ago
    Technically it is possible and it is something quite simple:

    1. You develop web application which contains URL, number of users and test duration in seconds
    2. On click of "start test' button the web application launches JMeter in command-line non-GUI mode like


    3. Another app to analyze testresults.jtl

    Thread Group should look like



    And HTTP Request like

    4 years ago
    You need to convert your variable(s) to properties, take a look at __SetProperty() function. JMeter variables are local to Thread Groups and JMeter properties are global for the whole JVM instance.

    See How to Use Variables in Different Thread Groups guide for detailed instructions.
    4 years ago
    Yes, the approach is the same: record, correlate, parametrise, replay. During recording make sure you import JMeter self-signed certificate (ApacheJMeterTemporaryRootCA.crt) on the device. The easiest way is to send it by email and open the message on the device.

    Alternate option is using Mobile Recorder service

    Also make sure you add [urlhttp://jmeter.apache.org/usermanual/component_reference.html#HTTP_Header_Manager]HTTP Header Manager[/url] to send mobile device User-Agent string.
    4 years ago