Jmeter console manipulation for automation purposes - console

I am pretty newbie by this question.
I want to know about possibilities of how to manipulate Jmeter through the console (bash or cmd).
My goal for a start consists in understanding of how to run my testplan.jmx for several URLS. For this I add "server" and "port" parameters into my testplan.
How could I can change these parameters through the console and then run Jmeter ?
Morover, I want to ask you guys to suggest any free online tutorials where I can learn more about "Jmeter in non gui mode" and possibilities for integration Jmeter between different frameworks to use for automated testing.
Thank you very much indeed.

See:
http://jmeter.512774.n5.nabble.com/How-to-Run-Jmeter-in-command-line-td2640725.html
You can launch your test plan from the command line, specifying parameters, like:
jmeter -n -t plan.jmx -Jmy_url=http://www.firsturl.com
Inside your testplan you'd reference that command line param as ${__P(my_url)}
In terms of capturing results when running in non-gui mode, you may want to see:
http://blogs.amd.com/developer/2009/03/31/using-apache-jmeter-in-non-gui-mode/
Personally, my experience is with using the GUI and writing and running test plans that way but this seems workable.

Related

Splitting an OSGi console into input and output consoles

I am wondering if it is somehow possible to have an OSGi environment with GoGo shell running with different consoles for input and output.
It is not very handy to write gogo commands into a console where your system is logging a lot of data.
Is there a good solution for that?
There are a number of solutions for your question.
You can use the telnet or ssh interface to gogo. Apache Felix provides both in separate bundles.
Gogo registers a CommandProcessor from which you can make a CommandSession by supplying an Input and Output Stream. It is quite easy to make a small Java Swing program that acts as a shell
Stop logging so much :-)

Is there any way to call Inform7 from the command line?

is there any way to play inform7 from the command line? I'd like to write some automated test script that plays the play with certain commands and don't want to do it manually. Is there any way to do that?
This is easiest to do with the CLI Linux package of Inform 7. It contains a perl CLI script you can run, but you may also like to consider this alternative script I wrote: https://github.com/i7/kerkerkruip/blob/master/tools/build-i7-project
You can invoke this with
build-i7-project -p "Project Folder"
(Leave off the .inform.)
You can also run the binaries which are installed with the IDE packages by themselves instead of installing the CLI Linux package. The command line options are probably mostly the same in other operating systems, but you may need to change them slightly. If you can't get it to work, compare with what the Inform 7 IDE says when you build with it.
If what you really want to do is periodically run some test scripts that verify that your work is still performing as expected, then Inform 7 has the capability do do that from within the IDE. Take a look at chapter 24.2 of Writing with Inform for details. In combination with good use of the Skein, this should handle the more common unit-testing requirements.
Of course, if you're doing something more outré, running bash scripts from the command line may wind up being the way to go. Still, don't do any more work than you have to. :)

phantomjs intercept response headers

I am currently creating a test script using codeception webdriver, I decided to run this script automatically every after a specified interval to know whether or not my application is still working. With its capability on generating error logs and screenshots this automated testing tool has been helpful. But I personally think that getting response headers would be more helpful. Is there anyway I could do this without changing the frameworks I have been using? If so, could you guide me on how to implement this?

Web Automation that can also run Unix Commands

Does anyone know of web automation software/app that also can run unix scripts? I know of the standard ones, but can't find out whether I can also run Unix scripts.
It's pretty common to multitask like that inside of Selenium WebDriver automation code.
For example, you could write a Selenium test in Python that also launches arbitrary external programs/scripts via Python's built-in support for executing commands.

How to run tests in same browser in parallel using selenium webdriver?

We have set of automated test cases around 2000 and we need to run them daily on every new build that come up. It's currently taking 4 hours to finish the test on one machine. In order reduce this we planning to run tests in batches (500 per batch) on same machine by initiating multiple browsers of same type. Say 4 firefox browser sessions per test suite. So it can finish in 1 hour time.Is it possible to achieve this using selenium webdriver and testng? Please suggest.
It is possible using Selenium Grid and TestNG. Grid can help distribute your tests on various machines or browser instances as you require. To get started, refer : Grid2
I think you might need to change your driver instantiation code a bit to include RemoteWebDriver instead of concrete drivers, but would be ok if your driver instantiation code in your framework is isolated. TestNG and Grid can help provided your tests are well written to support parallel execution.
For TestNG, you can refer, parallel running in TestNG.
If you are using Python - the best way to go is to use py.test to drive the tests. To distribute the tests the pytest-xdist plugin can be used.
Anyway, for both Java and Python you can use Jenkins to run/distribute your tests (using Selenium plugin)

Resources