The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1 | 2 | 3 | >> (show all)
neethu_dolly
Member


Reged: 04/12/07
Posts: 201
How can we capture what user cliks in Msgbox
      #379528 - 05/10/07 02:25 AM

hi

It needed in the script that i take user input initially before the scripts run.

its like this. i have to report the URL used to launch the App ask if that's the one he want to use.
i thought i will do it with "MSGBOX" with OK and Cancel

but now i have to capture what button user clicks and it its Cancel, i have to ask for an alternate URL...

can we do all this just with INPUTBOX..?
can somebody help me...

many thanks
neethu


Post Extras: Print Post   Remind Me!   Notify Moderator  
robbiewinston
Super Member


Reged: 03/06/06
Posts: 1554
Loc: Bristol, UK
Re: How can we capture what user cliks in Msgbox [Re: neethu_dolly]
      #379530 - 05/10/07 02:30 AM

The help guide gives an example of how to do this. Have you looked it up?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Jits
Advanced Member


Reged: 01/31/07
Posts: 492
Loc: Pune, India
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379532 - 05/10/07 02:36 AM

In Message box you can simply do it by,

For e.g.,
Abc = Messagebox("......","...")
If Abc = VBOK then
' Do operation
Else
' ...
End If

Let me know if anything wrong into this.

Regards,
Jitesh Sojitra


Post Extras: Print Post   Remind Me!   Notify Moderator  
neethu_dolly
Member


Reged: 04/12/07
Posts: 201
Re: How can we capture what user cliks in Msgbox [Re: Jits]
      #379535 - 05/10/07 02:46 AM

jitesh..

i tried somthing like this..

URL=Inputbox ("Url specified to Open Application is :"&(Chr(13))&"" &DataTable.Value("URL",dtGlobalSheet)&""&(Chr(13) & Chr(10))&"Click 'OK' to continue. Or Enter desired URL and Click 'OK'.","Enter URL")

now am blindly using the what ever value URL has to launch the Application..

But the URL displayed get cut because of button cause to too lengthy...

can something be done for this..

thanks jitesh

Neethu


Post Extras: Print Post   Remind Me!   Notify Moderator  
robbiewinston
Super Member


Reged: 03/06/06
Posts: 1554
Loc: Bristol, UK
Re: How can we capture what user cliks in Msgbox [Re: Jits]
      #379536 - 05/10/07 02:47 AM

I've tried using keywords (eg. vbYes, vbNo, etc.), but with no luck.

I've always had to use the numeric value instead.

In the case of vbOk, it has a value of "1".

so;

Abc = Messagebox("......","...")
If Abc = 1 then
' Do operation
Else
' ...
End If


Post Extras: Print Post   Remind Me!   Notify Moderator  
neethu_dolly
Member


Reged: 04/12/07
Posts: 201
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379538 - 05/10/07 02:58 AM

And I have a question... if i am not expecting too much out of QTP..


this may sound funny but is greatly use full to me

can there be a time out for these msgbox's and input boxe's so that if we schedule the same script, script shold continue running with data sheet values instead of waiting for user input for ever

going crazy...
neethu


Post Extras: Print Post   Remind Me!   Notify Moderator  
robbiewinston
Super Member


Reged: 03/06/06
Posts: 1554
Loc: Bristol, UK
Re: How can we capture what user cliks in Msgbox [Re: neethu_dolly]
      #379540 - 05/10/07 03:09 AM

Not sure, but probably not with your basic msgbox/inputbox, but I'm more than happy to be proved wrong

Post Extras: Print Post   Remind Me!   Notify Moderator  
neethu_dolly
Member


Reged: 04/12/07
Posts: 201
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379541 - 05/10/07 03:15 AM

this should be easy question..

it throws systax error if i use :

Flag = MsgBox ("Url specified to Open App is :"& (Chr(13)) &""&DataTable.Value("Url",dtGlobalSheet)&""& (Chr(13)) &""& (Chr(13)) &"Click 'OK' to continue. "& (Chr(13)) &"Click 'Cancel' to specify a different URL.",""&vbOKCancel&""&vbQuestion&","Enter new URL")


am actually trying to format the msgbox to look decent enough..
could you please help how to use vbOKCancel vbQuestion to gether..

i tried with :

&vbOKCancel&,&vbQuestion&
vbOKCancel,vbQuestion
and so on
thanks Robbie

~ neethu


Post Extras: Print Post   Remind Me!   Notify Moderator  
robbiewinston
Super Member


Reged: 03/06/06
Posts: 1554
Loc: Bristol, UK
Re: How can we capture what user cliks in Msgbox [Re: neethu_dolly]
      #379545 - 05/10/07 03:34 AM

have you tried vbOKCancel + vbQuestion?

Post Extras: Print Post   Remind Me!   Notify Moderator  
neethu_dolly
Member


Reged: 04/12/07
Posts: 201
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379547 - 05/10/07 03:38 AM

Hey that works.....


thanks,
thanks you so much..

neethu


Post Extras: Print Post   Remind Me!   Notify Moderator  
Turbografx
Super Member


Reged: 10/21/05
Posts: 1756
Loc: London, U.K
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379549 - 05/10/07 03:40 AM

Could always use a Userform. Much more customizable.

Post Extras: Print Post   Remind Me!   Notify Moderator  
robbiewinston
Super Member


Reged: 03/06/06
Posts: 1554
Loc: Bristol, UK
Re: How can we capture what user cliks in Msgbox [Re: Turbografx]
      #379552 - 05/10/07 03:43 AM

Quote:

Could always use a Userform. Much more customizable.




Sounds interesting, tell me more!


Post Extras: Print Post   Remind Me!   Notify Moderator  
Turbografx
Super Member


Reged: 10/21/05
Posts: 1756
Loc: London, U.K
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379555 - 05/10/07 03:48 AM

1. Create a userform in Excel.

Eg. Select environment with option buttons

2. Create code in excel to handle user selection and pass information back to QTP.


Post Extras: Print Post   Remind Me!   Notify Moderator  
neethu_dolly
Member


Reged: 04/12/07
Posts: 201
Re: How can we capture what user cliks in Msgbox [Re: Turbografx]
      #379561 - 05/10/07 04:03 AM

Cool...

Does this support timeout if nobody attends to input boxes and msg boxes..!

If yes, it would be of great use..

kindly mention any resourse or link to help me do this...

thank you soooo... much
~neethu


Post Extras: Print Post   Remind Me!   Notify Moderator  
neethu_dolly
Member


Reged: 04/12/07
Posts: 201
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379568 - 05/10/07 04:25 AM

Robbie... did you try that..

do you think it can support a timeout kind of thing if we dont attend to the scripts.

found userforms here in these links
http://www.contextures.com/xlUserForm01.html#SetUp
http://j-walk.com/ss/excel/tips/tip76.htm

i didnt find any time out property there..

thanks Robbie


Post Extras: Print Post   Remind Me!   Notify Moderator  
Turbografx
Super Member


Reged: 10/21/05
Posts: 1756
Loc: London, U.K
Re: How can we capture what user cliks in Msgbox [Re: neethu_dolly]
      #379589 - 05/10/07 05:21 AM

Yeah, can support timeout no probelm. Just use 'ontime'

That second link is to John Walkenbach's site. He is an excel genius.


Post Extras: Print Post   Remind Me!   Notify Moderator  
robbiewinston
Super Member


Reged: 03/06/06
Posts: 1554
Loc: Bristol, UK
Re: How can we capture what user cliks in Msgbox [Re: Turbografx]
      #379602 - 05/10/07 05:39 AM

Forgive me for being stupid, but how do I then call the userform within QTP?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Turbografx
Super Member


Reged: 10/21/05
Posts: 1756
Loc: London, U.K
Re: How can we capture what user cliks in Msgbox [Re: robbiewinston]
      #379604 - 05/10/07 05:44 AM

Forgiven

You don't call the userform, you call a sub in excel that calls the userform.

i.e oExcel.Run ("'C:\test.xls'!mymacro")


Post Extras: Print Post   Remind Me!   Notify Moderator  
robbiewinston
Super Member


Reged: 03/06/06
Posts: 1554
Loc: Bristol, UK
Re: How can we capture what user cliks in Msgbox [Re: Turbografx]
      #379615 - 05/10/07 06:19 AM

So you create an excel object in QTP?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Turbografx
Super Member


Reged: 10/21/05
Posts: 1756
Loc: London, U.K
Re: How can we capture what user cliks in Msgbox [Re: neethu_dolly]
      #379621 - 05/10/07 06:27 AM Attachment (154 downloads)

This could turn into a long thread !!

Here's the idea. Paste this in QTP :

set oExcel = Createobject("excel.application")

msgbox oExcel.Run ("'C:\test.xls'!mymacro")

oExcel.quit
set oExcel = Nothing


Then save excel file in root of c:\

Edited by Turbografx (05/10/07 06:27 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | 3 | >> (show all)



Extra information
0 registered and 47 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating: *****
Topic views: 7522

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5