SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Feb 2005
    Location
    Bangalore, India, India
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Need help to understand WindowActivateFailed-excep

    Hi,

    I am automating a web application using RFT. I have a scenario where my application will generate a word file and I need to verify the content of the word file. For this scenario I used the following approach.
    1. Initially I am taking the list of all teh window objects from getTopWindows() method
    2. I am comparing the window class, if the windows class is a word class then this is the window I am looking for.
    3. Then I am trying to input the keys Ctrl+C and Ctrl+A through inputKeys() method so that I will get the content of the word document into clipBoard.
    4. Later I am reading the system clip board through getSystemClipBoard() method into a String variable.

    With this approach I am able to get the contents and my requirement is covered. But in Step 3 RFT gives the following exception:
    "com.rational.test.ft.WindowActivateFailedExceptio n"

    I have simply kept the code in try catch block so that this exception will not stop the execution and proceeding with reading the content. But I would like to understand why am I getting this exception so that I can make my code any exception free.

    Below is my code for your reference.

    public String getWordDocText()

    {
    String docText = null;
    IWindow[] browserWindow = getTopWindows(); //Get all the window objects as an array
    for(int i=0;i<browserWindow.length ; i++) // Iterate through window objects array
    {

    if(browserWindow[i].getWindowClassName().contains("OpusApp")) //If class equals to OpusApp then that is a word window
    {
    try
    {
    browserWindow[i].maximize();
    browserWindow[i].inputKeys("^a^c"); //Giving the characters "Ctrl+a and Ctrl+c" and this is where I am getting the exception
    }
    catch(Exception e)
    {
    logInfo("Exception occured : "+e.getMessage()); //displaying the exception and continuing with my execution
    }
    docText = getSystemClipboard() .getText(); //reading from system clipboard

    browserWindow[i].close(); //closing the word window.
    }

    }
    return docText;

    }

    Please help me in understanding the reason for exception.

    Thanks,
    Vamsee Krishna K.
    Thanks & Regards,

    Vamsee Krishna K.

  2. #2
    Member
    Join Date
    Sep 2006
    Posts
    204
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Need help to understand WindowActivateFailed-excep

    You can try including browserWindow.activate() before ctrl+A and Ctrl+c.

    Other option may be
    1.you can save the file in a separate location
    2.create a file object of that word file
    3.get the contents of it and verify.
    4. if needed, delete that file object

    This should be faster and more reliable.

  3. #3
    Junior Member
    Join Date
    Feb 2005
    Location
    Bangalore, India, India
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Need help to understand WindowActivateFailed-excep

    Hi Voks,

    Thanks a lot for the reply and sorry for the delay in responding. Actually this exception is not occuring in actual test environment. So I do not have any issue now.

    Regards,
    Vamsee
    Thanks & Regards,

    Vamsee Krishna K.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:23 AM.

Copyright BetaSoft Inc.