GeekInterview.com
Series: Subject:
Question: 10 of 148

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
Asked by: agarwalankur | Member Since Jan-2008 | Asked on: Jan 6th, 2008

View all questions by agarwalankur

Showing Answers 1 - 3 of 3 Answers

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

  
Login to rate this answer.

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.

  
Login to rate this answer.
a_katiyar

Answered On : Aug 28th, 2008

View all answers by a_katiyar

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

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.