Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » RCPTT command has been recorded but this command not executed if script running(RCPTT command has been recorded for actions on certain window (in record mode) but this command not executed if script running.)
RCPTT command has been recorded but this command not executed if script running [message #1771497] Fri, 25 August 2017 16:43 Go to next message
Alexander Chernyaev is currently offline Alexander ChernyaevFriend
Messages: 3
Registered: August 2017
Junior Member
Hello All,
I have to write an RCPTT test that checks the IDE S32DS response in case the user attempts to debug a C/C++ application when there is no connection to the hardware. In this case, the "P&E Connection Assistant" window should appear, on which need to press the "Abort" button. In the recording mode, I get a script that contains the following part of code:

exec-with-options {
get-window "P&E Connection Assistant" | get-button Abort | click
get-window "Problem Occurred" | get-button OK | click
} -allowStatusDialog

In the process of executing this script, all running properly up to this part of the code. The expected window appearing, but when executing the command: "get-window "P&E Connection Assistant" | get-button Abort | сlick " appears the error message: "The Window "P&E Connection Assistant" could not be found. At get-window ... ", and the script stops working. The "P&E Connection Assistant" window remains in the foreground of the screen. I have no thoughts about how to overcome this obstacle. I also do not understand why the "exec-with-options" construction is needed. For development of tests I use RCP Testing Tool IDE, Version: 2.2.0.
Experience of using RCPTT - 2 weeks. Before that, there was an experience of using "AutoIt" and "SWTBot".
Re: RCPTT command has been recorded but this command not executed if script running [message #1771733 is a reply to message #1771497] Wed, 30 August 2017 04:32 Go to previous messageGo to next message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Hi Alexander,

1) By default, RCPTT blocks showing all status dialogs ("Problem Occurred" dialog is one of them).
If click on status dialog is detected during recording, RCPTT adds 'exec-with-options {} -allowStatusDialog' to the script.
It is why this command is needed.

2) RCPTT cannot find 'P&E Connection Assistant' window due to bug with '&' symbol.
It has been fixed in the latest 2.3.0 nightly build. You can download it here: https://eclipse.org/rcptt/download/
If you want to use 2.2.0, there is a workaround -- just remove '&' symbol from the window name like this: 'PE Connection Assistant'.

P.S. When I try to reproduce your issue, I faced a problem with a windows dialog that should be closed by the test.
If you have faced it also, you can do it by 'exec-process' command.
Finally, my script looks like this:
get-view "Project Explorer" | get-tree | select "testproject: Debug"
get-view Dashboard | get-section "Build/Debug" | get-link Debug | click
with [get-window "Select Configuration"] {
    get-table | select "testproject_Debug_PNE"
    get-button OK | click
}

exec-with-options {
    get-window "P&E Connection Assistant" | get-button Abort | click
    try -times 3 -delay 1000 -command {
        exec-process "\"C:\\Windows\\System32\\taskkill.exe\"" "/FI" "\"WINDOWTITLE eq pegdbserver_console.exe\""
            | get stdout | contains "SUCCESS" | assert-true
    } -catch {
        throw-error "Cannot find a process to kill"
    }

    try -times 3 -delay 1000 -command {
        get-window "Problem Occurred" | get-button OK | click
    } -catch {
        throw-error "Cannot find a window 'Problem Occurred' to close"
    }
} -allowStatusDialog


Regards,
Viktoria
Re: RCPTT command has been recorded but this command not executed if script running [message #1771772 is a reply to message #1771733] Wed, 30 August 2017 10:11 Go to previous messageGo to next message
Alexander Chernyaev is currently offline Alexander ChernyaevFriend
Messages: 3
Registered: August 2017
Junior Member
Many thanks, Victoria.
Now the problem described by me is overcome.
However, there really is the following, the problem you described. I inserted your code: exec-with-options {...} -allowStatusDialog in my script. As a result, the "P&E Connection Assistant" window was successfully closed, but the error message "Can not find a process to kill" appeared. My hypothesis: "taskkill.exe" was started already after or during the process of how the window was closed? Or, perhaps, the process on my computer has a different name?
I will experiment!
Best Regards,
Alexander
Re: RCPTT command has been recorded but this command not executed if script running [message #1771780 is a reply to message #1771772] Wed, 30 August 2017 10:46 Go to previous messageGo to next message
Alexander Chernyaev is currently offline Alexander ChernyaevFriend
Messages: 3
Registered: August 2017
Junior Member
Hi Viktoria,
I removed the part of code:
try -times 3 -delay 1000 -command {
exec-process "\"C:\\Windows\\System32\\taskkill.exe\"" "/FI" "\"WINDOWTITLE eq pegdbserver_console.exe\""
| get stdout | contains "SUCCESS" | assert-true
} -catch {
throw-error "Cannot find a process to kill"
}
After this my script was over successfully.
Best Regards,
Alexander
Re: RCPTT command has been recorded but this command not executed if script running [message #1771832 is a reply to message #1771780] Thu, 31 August 2017 08:19 Go to previous message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Yes, this part of the code may help you only if you have a problem with open windows dialog, so, if you have not this problem, you can remove it.
Glad to help!
Previous Topic:AUT vm argument value with spaces in maven plugin
Next Topic:RCPTT Test Runner not finishing its job
Goto Forum:
  


Current Time: Sat Aug 18 20:00:09 GMT 2018

Powered by FUDForum. Page generated in 0.02170 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top