QTP - Scripting Doubts - I

Hey guys ,

Here is one more problem iam facing.

My application is a web based application, but it has many dialogue boxes coming up.
I need to validate the message which displays in the dialogue.
I am able to do all these things through my script ๐Ÿ˜€

But when I run the script after certain time the systems gets locked in our office , at that time the dialogue box messages are not getting clicked.
My script is failing.

So my question is , Is there any way such that we can make the system not to get locked.

I am currently using a work around using windows scheduler.
Is there any effecient method?

Replies

  • Rajni Jain
    Rajni Jain
    are you using sendkey methods for the given scenario, because what I can think of script will fail only when you will use active desktop (keyboard or mouse movements). this is not really a great method to do.

    Anyways, you can start VNC server on that machine which will not allow the machine to lock. Or ask your admins to change the group policy for your system.

    Try going in power and change settings to not lock the system.

    also, do let us know if any of this methods works fine with you.

    -CrazyGirl.
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    i spoke regarding the setting they didnt accept.

    So i am using send keys method in windows scheduler which is working fine.

    My question is ,is there any setting in qtp such that we can find a work around for this ?
  • Anil Jain
    Anil Jain
    English-Scared
    i spoke regarding the setting they didnt accept.

    So i am using send keys method in windows scheduler which is working fine.

    My question is ,is there any setting in qtp such that we can find a work around for this ?
    No, I never found any settings in QTP which will stop system to lock.

    Only alternative solution is to start something which will keep on talking to others (As suggested by CrazyGirl) and keep system alive and unlocked.

    -CB
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    I even heard there is a freeware called Caffeine which keeps the system unlocked.

    But as far as i know , the windows scheduler method is the work around ( if not allowed to change the power settings)


    Thanks CG for the reply ๐Ÿ˜€

    What exactly is VNC server? Can any one make it clear.
  • Anil Jain
    Anil Jain
    Virtual Network Computing

    Using VNC client you can connect to a system where VNC server is started. Actually VNC server keep on doing the broadcast its IP, If any VNC client ping that with authentication, server allows client to make an connection.

    As you are talking about caffine, it will do the same. It will keep on doing the broadcasting (Not in negative sense and will deffinately not effect / jam your network) or keep doing some actions - similar to what you are doing using windows schedular.

    Keep posting your doubts and solution if you get.

    -CrazyBoy
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    Here is another question.


    How to send Email From Outlook through QTP?

    Iam able to send the Email using qtp ๐Ÿ˜€ , But before it is sending it is giving a pop up error message , a dialogue message .

    So anyone came across this issue?
  • Anil Jain
    Anil Jain
    What is the error message???

    There are two way of sending mails.

    1. Using Outlook. For this outlook needs to be installed and configured, Also if needs authentication before sending a mail. Credentials should be passed in the send mail script.

    2. Using SMTP server directly (Search CDO.mesage you will get a lots of material).

    By the way which dialog message you are getting??

    -CB
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    Please check the following link.

    #-Link-Snipped-#

    Here ,they explained the problem and procedure to avoid it..
    Still it is not working.

    Please let me know if you have any questions.

    Moreover sending mail using CDO object doesnt have any problem.
    But, when we try to read a mail using QTP , if we try to retrieve the body of the mail we get the same error pop - up.

    I tried using Recovery Scenario and sendkeys still it didnt work.
  • Anil Jain
    Anil Jain
    Have you installed ClickYes utility... I am using ClickYes since long time, and facing no problem with it. Its working perfectly with me.

    Explain your problem in detail...

    -CB
  • Anil Jain
    Anil Jain
    By the way which Outlook version are you using??? Is it 2007 or 2003???

    Actually check this:

    Express ClickYes is a tiny program that runs in the system tray and automatically clicks the Yes button for the Outlook security prompt, that asks you to confirm mail sending from third party applications or access to Outlook's address book.

    It is compatible with:
    - Outlook 2003
    - Outlook 2002 (SP1, SP2 and SP3)
    - Outlook 2000 SP1+SR1
    - Outlook 2000 SP2

    ClickYes doesn't work with Outlook Express. There is an appropriate option in the Outlook's Express settings. To turn the prompts off, click 'Options' on the menu, switch to the 'Security' tab, and clear the 'Warn me when other applications try to send mail as me' checkbox.

    -CB
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    I am using 2003 , I am not authorised to install the clickyes program ๐Ÿ˜”

    Thats the reason I am trying to click yes using script.
  • Anil Jain
    Anil Jain
    English-Scared
    I am using 2003 , I am not authorised to install the clickyes program ๐Ÿ˜”

    Thats the reason I am trying to click yes using script.
    Express ClickYes is the Freeware and you can easily get approval from your management team to get it installed by IT team.

    I do not think that administrators will have objection on installation of this.

    -CB
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    Yes CB, I have spoken to my Team management for the installation.
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    For the above problem if we place this vbs in our system and run through some external source not qtp it should work.
    Still it is not working.

    The code is
    Set fso = CreateObject("WScript.Shell")
    While fso.AppActivate("Microsoft Outlook") = FALSE
    wscript.sleep 1000
    Wend
    fso.SendKeys "a",True
    fso.SendKeys "y", True

    wscript.sleep 7000
    While fso.AppActivate ("Microsoft Outlook") = FALSE
    wscript.sleep 1000
    Wend
    fso.SendKeys "y", True
  • Anil Jain
    Anil Jain
    Code looks fine to me, ๐Ÿ˜”

    Have you tried installing ClickYes utility?? Any luck on that??

    -CB
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    Not yet dude.

    There is a big process here , I need to raise a request , need to get approval from manager etc etc...

    So they said it takes some time.

    So meanwhile trying for other methods of solving the issue.
  • Anil Jain
    Anil Jain
    You are using sendkey method in the above mentiod code. The best I can think is, this is issue of focus. In automation, whenever you use the sendkey method, focus should be on the application on which you want to perform action. I am assuming that machine is not in locked state and focus is on the dialog box only when you are executing this piece of code.

    Another advice is try giving wait of 5 seconds and in these five seconds set focus on that winodw before using sendkey.

    Hope this may help you.

    -CB

You are reading an archived discussion.

Related Posts

To day an engineering become very extrem and popular.So what you think engineering an art or not?
WHERE TO SEARCH FOR THE RESULTS IN THE WEB ??? wOULD ANYONE HELP ME...........
Hiiiiii.,..... Hello everyone...Now I am persuing my B tech (Computer Science) 3rd year.. ๐Ÿ˜› And In 4-1, I have a mini project...There are so many project ideas in this thread..But...
Hi.... Its very sad to say My sir is not explaning DBMS clearly and neatly. ๐Ÿ˜” ๐Ÿ˜” ๐Ÿ˜” .I think it is a important subject for CS/IT students...Can anyone suggest...
Where should i get the letest project information?๐Ÿ˜•