GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  WinRunner
Go To First  |  Previous Question  |  Next Question 
 WinRunner  |  Question 139 of 146    Print  
button pressed using winrunner
I want to know whether a button is pressed by the user or not. I want to use this in an if statement. Does any1 know about this? Please help


  
Total Answers and Comments: 3 Last Update: August 29, 2008     Asked by: agarwalankur 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 28, 2008 07:21:38   #1  
sushma_srikrishna Member Since: November 2007   Contribution: 20    

RE: button pressed using winrunner

yes u can check the status of the button ,u need to take the info from the application and u need to compare it with the actual value.

say u have a OK button which is enabled, u need to check whether its enabled or not.

u can write a fnction

public function button_check(in object, in status)
{
auto value;

button_get_info(object,"enabled",value);

if(status==value)

{

tl_step("button status check",PASS,"button is enabled");
return E_OK;
}
else
{
tl_step("button status check",FAIL,"button is not enabled");
return E_GENERAL_ERROR;
}
}

call this function

button_check("OK","1")

any doubts pls revert


 
Is this answer useful? Yes | No
April 11, 2008 02:17:36   #2  
deshmukhsarang2003 Member Since: April 2008   Contribution: 5    

RE: button pressed using winrunner
I think the answer mentioned above is wrong.
As above script checks whether the button is enbled or disabled and not the button is pressed or not.
As pressing button does not necesarily disbled it.

 
Is this answer useful? Yes | No
August 28, 2008 23:31:04   #3  
a_katiyar Member Since: August 2008   Contribution: 11    

RE: button pressed using winrunner
Checking button wether it was pressed or not depends on behavior of button when pressed, its correct we can not always check the state of button, but if button is changing its state from enabled to disabled then the function mentioned in first answer can be used.
Else we can also check what are the changes happening after pressing the button (say color of button, button label, any pop-up, any other updation on page/application, any updation in database etc.) to make sure button was pressed.

Regards,
-AK

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape