Need help to understand WindowActivateFailed-excep
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:
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
browserWindow[i].inputKeys("^a^c"); //Giving the characters "Ctrl+a and Ctrl+c" and this is where I am getting the exception
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.
Please help me in understanding the reason for exception.