require 'net/ldap'
class LDAPConn
HOST = "ldap.yourcorp.dev"
# 636 for ssl binding
PORT = "636"
USERNAME = "TestLDAP"
PASSWORD = "abcd1234"
TREEBASE = "OU=UserAccts,DC=yourdomain,DC=com"
def LDAPConn.getLDAP
ldap = Net::LDAP.new(:host => HOST,
:port => PORT,
:auth => {
:method => :simple,
:username => USERNAME,
:password => PASSWORD
},
:encryption => :simple_tls)
return ldap
end
def LDAPConn.validateLogin(email, password)
ldap = LDAPConn.getLDAP
filter = Net::LDAP::Filter.eq("mail", email)
result = ldap.bind_as(:base => TREEBASE, :filter => filter, :password => password)
return result
end
end
Sunday, September 15, 2013
LDAP sample in Ruby Code
Wednesday, August 07, 2013
How to do a multipart file upload in ruby
gem install httpclient
require 'httpclient'
require 'uri'
# Do multipart file upload with POST
httpreq = HTTPClient.new
File.open("#{filename}") do |file|
body = { 'year' => "#{curyear}", 'tag' => "#{tagname}", 'uploadfile' => file}
res = httpreq.post(URI("#{uri}"), body)
end
Wednesday, July 31, 2013
ActiveMQ Jmeter Test Plan on my github
Recently, i am testing the our message queue capacity and performance which is ActiveMQ...So i made a sample Jmeter test plan on my github, once someone want take a reference:
https://github.com/joychester/ActiveMQJMeterTestPlan
This reminds me one of my report issue to JMeter JMS Sampler 3 years ago :) Time flies!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=49111
https://github.com/joychester/ActiveMQJMeterTestPlan
This reminds me one of my report issue to JMeter JMS Sampler 3 years ago :) Time flies!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=49111
Wednesday, May 01, 2013
"PetGym" is on my github now -- Automated your Jmeter tests
Jmeter PluginCMD provide a capability for running jmeter tests automatically with many cool reports generated:
http://code.google.com/p/jmeter-plugins/wiki/JMeterPluginsCMD
I am writing a ruby program to meet my basic requirement during my performance tests.
Please check it out if you want to give it a try: https://github.com/joychester/PetGym
I am writing a ruby program to meet my basic requirement during my performance tests.
Please check it out if you want to give it a try: https://github.com/joychester/PetGym
Thursday, April 18, 2013
FastMole is on my GitHub now!
FastMole which is one of my project to do Continuous Page performance tests is on my github now:
https://github.com/joychester/FastMole




Tuesday, April 09, 2013
Generate Load by adding reasonable think time
I used to generate load by launching small number of VUs without any think time during performance testing.
The pros is You can trigger a very high load/Throughput even you are not creating many concurrent threads, but the cons is you can not generate consistent/stable load to make comparison once you make some tuning or changes.
Recently, I am discussing with my teammate ZhouZhou, and figure out how we generate a consistent load by adding reasonable think time(Little Law helps the calculation here) between each request, here is the diagram we made to show how much load/Throughput we can generate/get:
Thursday, August 30, 2012
Monitoring your load generator client, when the server CPU% is under utilized
Recently, I am using one Virtual Box(VMware/2 Cores / 8GB) to conduct performance/load testing.
With more and more load Jmeter generate, It seems the server's CPU% is not able to go up...
However, I noticed the my vitual-box client's CPU% has reached to 90%+. After changing to a physical and more powerful machine, everything is fine, server side CPU% can go up with increasing payload. I am not often to monitoring load generator client during my testing previously, and they are usually works fine as its physical machine.
You have to monitor your load generator machine as well when you find the server CPU% is under utilized(stay the same with even higher user load) and Server response time keep increasing, especially if you are using a Virtual Box to do performance testing, then please be caution!!
However, I noticed the my vitual-box client's CPU% has reached to 90%+. After changing to a physical and more powerful machine, everything is fine, server side CPU% can go up with increasing payload. I am not often to monitoring load generator client during my testing previously, and they are usually works fine as its physical machine.
You have to monitor your load generator machine as well when you find the server CPU% is under utilized(stay the same with even higher user load) and Server response time keep increasing, especially if you are using a Virtual Box to do performance testing, then please be caution!!
Wednesday, June 06, 2012
Deal with Modal Dialog in my WebDriver test
If you do not have an idea how to deal with the Modal Dialog in WebDriver Tests, here is my solution to it
For example the modal dialog pop-up after clicking "Logout" link, so the code like this:
"Mouse" hover to your WebElement as a bonus in case you are looking for:
For example the modal dialog pop-up after clicking "Logout" link, so the code like this:
driver.findElement(By.linkText("Logout")).click();
driver.switchTo().activeElement().sendKeys(Keys.ENTER);
driver.switchTo().alert().accept();
"Mouse" hover to your WebElement as a bonus in case you are looking for:
//simulate the mouse hover
Actions builder = new Actions(ldriver);
Action action = builder.moveToElement(sportslink).build();
action.perform();
Hope it helps!
Sunday, June 03, 2012
Performance doc written by me and the team
First of all, Thanks to Neil Feng, if you are not pushing me hard, I won't write something down :) Thank you and the team!You are awesome guys!!
I think it is a good things can be shared with anyone who is interested in performance engineering stuff, so in case you want to take peek at it...:
Hope it helps! Any comments or suggestions are welcomed!
--Cheng Chi
I think it is a good things can be shared with anyone who is interested in performance engineering stuff, so in case you want to take peek at it...:
https://docs.google.com/open?id=0B_hz_q1i5QXJTXZqd0FVblAzNms
Hope it helps! Any comments or suggestions are welcomed!
--Cheng Chi
Subscribe to:
Posts (Atom)
