Can i export a jmeter test as a script? - testing

I am trying to build a test framework for front end and back end services. One of the test I want to do is if a certain webpage loads well. I have made a simple test in jmeter, and now my question is: Can i export a script that will run this test on command without having to manually open jmeter?
The idea is that i will be able to go on a webpage and see the results from there. But also i want to be able to run the test when i want to remotely (obviously the back end server will trigger the script on http request)..
So is it possible to export a jmeter test script? if not, is there another tool that can do this?
Thanks in advance!
EDIT:
Ok, i think i found what i was looking for.. and in case anyone else needs something like this check out this link: http://www.programmerplanet.org/pages/projects/jmeter-ant-task.php

Yes, as soon as you have saved your test, you can start JMeter in many different ways - from Ant, from Maven, through a shell script, from continuous integration servers and so on.

Related

How to run tests in multiple environments (qa-dev) in TestParallel class and have results in one report?

We have QA and DEV environment in our automation repo. We are using karate as our framework. We have TestParallel class and integrated allure report.
How could we run all tests in QA first then in DEV back to back using TestParallel Class and see the results in the same report?
Thanks for such a great tool btw.
We are going to try and make this easier in the next version.
For now, you have to aggregate the reports yourself. Can you try this and let us know how it goes.
use the Runner class 2 times to run your tests with different settings and karate.env set for QA and then DEV
the important part is using a different value for the workingDir, e.g. target/reports/qa and then target/reports/dev - else the second run will overwrite the first
now when generating the HTML report, you can provide target/reports as the source folder. this should work for the Maven Cucumber Reports, for Allure, please figure this out on your own
if the above approach does not work well enough for your needs, please figure out a way to manually aggregate the Results object you get from each instance of the Runner, this should not be too complicated as Java code

Exporting Scripts

I'm a freelancer and if I create the scripts in Test Cafe can they be ported to another application or repository?
I ask because if my client decides for me not to continue running their scripts they will want them back.
Thanks
Bret
You can share test cases recorded in TestCafe Studio in the .testcafe format or convert them to JavaScript as #user2675036 mentioned. However, test cases are specific to a particular application you are testing. Could you please clarify what you mean by 'porting test cases to another application'?

Is it possible to skip fixture or whole file in testcafe if one test fails?

There is only one option in testcafe --stop-on-first-fail which stops the whole test run not only fixture or file. Is it possible to somehow separate or isolate the fixtures or files? My goal is to separate files in failure, so if there is a failure in the test, it will stop the whole file/fixture and the test run will continue to another file/fixture. I assume, this feature is not implemented yet and I will have to use javascript.
There is no such functionality in TestCafe right now, and I can't see any workaround for this scenario. I recommend you create a suggestion in the TestCafe github repository using this form.

How to easily 'interval' login a website and check its content whether has changed?

This is a bit high-level solution based question: I have a website, and what I need to do is login->navigate->click category->check whether the specific content has come; every 10 mins.
There are quite a few third-party services, but they only checking the website uptime, which is not what I need.
Currently, I am thinking of silly way: create a selenium UI test, and run it every 10 mins, which seems pretty complex.
Feels like need some tool, so that I can run some extra js on a particular web to test my functionality. Any good solution for this? even some js framework, or even third-party payable service that I can direct make use of?
Thanks.
The best way to do this is :
Create a selenium test - Single main method that does all the steps.
Export it as a runnable jar
Schedule the .jar execution using windows scheduler.
Before scheduling the jar, once just double click the .jar file and see if the steps run smoothly.
Alternately you can try using vbscript (.vbs) file also.

Prefill new test cases in Selenium IDE

I'm using Selenium IDE 2.3.0 to record actions in my web application and create tests.
Before every test I have to clear all cookies, load the main page, log in with a specific user and submit the login form. These ~10 commands are fix and every test case needs them, but I don't want to record or copy them from other tests every time.
Is there a way to configure how "empty" test cases are created?
I know I could create a prepare.html file or something and prepend it to a test suite. But I need to be able to run either a single test or all tests at once, so every test case must include the commands.
Ok I finally came up with a solution that suits me. I wrote custom commands setUpTest and tearDownTest, so I only have to add those two manually to each test.
I used this post to get started:
Adding custom commands to Selenium IDE
Selenium supports object-oriented design. You should create a class that takes those commands that you are referring to and always executes those, in each of the tests that you are executing you could then make a call to that class and the supporting method and then execute it.
A great resource for doing this is here.