Tuesday, 10 January 2012

Jmeter: pass a value between threads


Find out ways to pass a value between threads (i.e. capturing a value in one of the thread and passing it to the other thread in the same test plan).

Tool Used:     JMeter: Performance testing tool.

Solution:       Sharing Variables

1)      Used Sampler : BSF Sampler
1)      Screenshot displaying the use of the BSF Sampler using  ${__setProperty(storeid, ${storeid})}; for capturing the time. The website used is http://www.mail-archive.com/jmeter-user@jakarta.apache.org/info.html for displaying the value captured in one thread to the other thread.
Screenshot 1: Displaying the BSF Sampler capturing the time value using ${__setProperty(storetime, ${__time(HMS)})};

Screenshot 2: Displaying the time captured using ${__property(storetime)} in the other thread.

Screenshot3: Successful execution of the script displaying the time value captured in Thread2

QTP : object is Visible OR Not on Web Page

Hi All,
Some times we have to  check that a object(WebElement) is  exist on page or not. For this we use object exist = False  property but when we run the script it gets failed While object is not showing in the Page. We think that there is  something  wrong.
The reason behind why QTP  is giving this because object is present in the page but not visible means it not displaying while it exist in HTML code.
So for this we have to be understand the object property( object.currentstyle.display) there will be case some time object inherit the property from its parent or another parent element property to display in page. First we have to identify that object when it not showing/displaying in page.We have to check its display property
Display property value we can get through like this 

rem disvalue

disvalue =Browser(“Google”).Page(“Google”).Image(“Happy Holidays from Google!”).Object.currentStyle.display
if disvalue =”block” then
print ” object not displaying”
print ” object displaying”
end if
like this(incase if object using display property from its  parent object )  we have to check by which element my object showing on page

Which one is right ?