JMeter parametrize variable. how to switch between url variable - jmeter

I did parametrize URL variable in JMeter.
I did this by .csv file.
I have one .csv file, in which I have protocol, host and port;
in protocol I have dev, preprod, prod and local,
and I want to switch between dev, preprod, prod and local.
My CSV file is following:
protocol host port
dev dev.mycom.io 80
preprod preprod.mycom.io 80
prod prod.mycom.io 80
localDev local.mycom.com 8080
What can I switch between this address?
What command must I write in command line?
And what can I check protocol?

You can do this through user defined variables if you want:
Name:HOST Value:${__P(HOST,local.mycom.com)}
Name: PORT Value: ${__P(PORT,8080)}
This will default the HOST to local.mycom.com and PORT to 8080, if no command line parameters are passed, you can then pass the new HOST and PORT in when running the test via the command line using:
-JHOST=dev.mycom.io -JPORT=80
Your test would then point to dev.mycom.io:80
However, this does not satisfy your requirement to use a csv.

Related

Jmeter Distributed testing - unable to connect the remote (slave systems)

Jmeter Distributed testing - unable to connect the remote (slave systems)
I am getting the below error
"non-JRMP server at remote endpoint"
It looks like an incorrect setup of RMI ports, JMeter master tries to connect to the slave machine using the hostname or IP address and port which is specified in the remote_hosts property or passed via -R command line argument.
The error means that something else, not JMeter's RMI registry is running on machine 192.168.0.103 on port 1099.
So you need to connect to your slave machine and check what's listening on port 1099 using netstat or equivalent and either terminate that application or amend JMeter configuration to use different port.
More information: How to Perform Distributed Testing in JMeter

apache-jmeter-5.4.1 Server failed to start: java.rmi.server.ExportException: Listen failed on port 4000

In centos environment I setup a rmi_keystore.jks in master device and copy it to the bin of Jmeter worker machine too.
In my master device's jmeter.properties file I only did below changes.
remote_hosts=10.54.225.200
server.rmi.localport=4000
However, In worker device, when I try to start the server.
by giving master's hostname is 10.54.225.190
cd apache-jmeter-5.4.1/bin
./jmeter-server -Djava.rmi.server.hostname=10.54.225.190
below error occurs. The port 4000 is not in used though.
If you need to use different SERVER_PORT instead of default 1099 I believe you need to amend your setup to something like:
Slave: jmeter-server -Jserver_port=4000
Master: jmeter -R 10.54.225.200:4000 -n -t test.jmx
See Using a different port user manual entry for more details if needed.
If you want to customize further refer the following materials:
Apache JMeter Distributed Testing Step-by-step
Remote hosts and RMI configuration
JMeter Distributed Testing with Docker

Can we create a playbook to install a package in our own system?

I'm using Ubuntu Linux
I have created an inventory file and I have put my own system IP address there.
I have written a playbook to install the nginx package.
I'm getting the following error:
false, msg" : Failed to connect to the host via ssh: connect to host myip : Connection refused, unreachable=true
How can I solve this?
You could use the hosts keyword with the value localhost
- name: Install nginx package
hosts: localhost
tasks:
- name: Install nginx package
apt:
name: nginx
state: latest
Putting your host IP directly in your inventory treats your local machine as any other remote target. Although this can work, ansible will use the ssh connection plugin by default to reach your IP. If an ssh server is not installed/configured/running on your host it will fail (as you have experienced), as well as if you did not configure the needed credentials (ssh keys, etc.).
You don't need to (and in most common situations you don't want to) declare localhost in your inventory to use it as it is implicit by default. The implicit localhost uses the local connection plugin which does not need ssh at all and will use the same user to run the tasks as the one running the playbook.
For more information on connection plugins, see the current list
See #gary lopez answer for an example playbook to use localhost as target.

Connect to Juggernaut with Ruby

require "juggernaut"
Juggernaut.publish("channel1", "Some data")
The code above works if Juggernaut is on the same server as the one running the code. What's the syntax to use a Juggernaut running on another server?
The syntax is the same. I have a juggernaut.yml config file in my config directory with settings for each environment. To run juggernaut on port 8080 of localhost in development, I have:
development:
host: 'localhost'
port: 8080
To run it on a different host, you can just change that host setting (e.g. 'jugg.someserver.com')

Having a url of : 'example.com' instead of 'localhost:8888/drupal' [Mamp]

How can i run local tests ( with mamp ) that have urls of this kind : www.example.com instead of http://localhost:8888/install.folder
Thank you
If your tests are truely local, you may simply add an alias in your hosts file (/etc/hosts on linux). This alias will cause your computer to resolve www.example.com as 127.0.0.1 (localhost).
If you wish to use this outside of your computer, you will need to purchase a domain, and set its DNS up to forward to your IP address (and open the appropriate port in your router to forward to your computer).
If you don't want to have to include the port number (':8888'), change the port that your server is being hosted on to the default (80). This may be done through the server's configuration file by changing the 'Listen' directive.
If you do not want to have to add the '/drupal' path, add an 'Alias' directive to redirect the user from the root path ('/') to '/drupal'. You may also change the 'DocumentRoot' to drupal.
You will need to add an entry to your hosts file like this:
127.0.0.1 www.example.com
Note: this will not keep you from having to enter the port number or directory - it will only allow you to use a host alias for the host name itself.

Resources