Closing Chrome Gracefully

Wednesday, March 7, 2018 6:43:11 PM

Hello,

    I am trying to make a practice of including a step at the end of my RVL scripts that closes Google Chrome in a graceful manner. Previously,  a help desk person told me to include this row in my RVL script:

           Action     Global       DoSendKeys        {%F4%}

 

At one point this seemed to work, but now I get an error message whenever I run the script saying that {%F4%} is not valid input for that step. I've also tried replacing {%F4%} with {^+Q} (CTRL-Shfit-Q) to close it, but that produces the same error message. I stay away from using:

      Action    Global    DoKillByName    chrome.exe

     Action    Global    DoKillByName     rapisechrome.exe

Both of these steps work correctly, but when I use them and reopen chrome I get the little prompt in the corner of the window that says Chrome closed unexpectedly and wants to know if I want to restore the page. Personally, I don't like that little prompt because I imagine it might cause issues later on if I ever need to make a recorded manual step or do an image comparison that involves the same area of the screen that is covered by that little prompt. Does anyone know how I can close Google Chrome (better yet all browsers) at the end of my script in a way that won't cause that little restore prompt to appear.

2 Replies
Thursday, March 8, 2018 2:41:24 PM
Avatar
re: Pinto18 on Wednesday, March 7, 2018 6:43:11 PM

Hi Nicholas,

The classic way is to kill the process (which you mention below), however it does have the side effect of making Chrome unhappy on startup. The alternatives are to tell Chrome to shutdown as if a user did it. The two ways are to either record a DoLClick(....) on the close button of the browser window (which will be treated as a Windows event rather than a browser event), or to use the DoSendKeys approach.

I think the issue is just that it should be:

{F4}

Regards

Adam

Thursday, March 8, 2018 3:52:24 PM
Avatar
re: inflectra.adam on Thursday, March 8, 2018

Adam,

    Thanks for the response. I added a line in my RVL script that looks like:

                Action       Global       DoSendKeys      keys      string       {F4}

 

Unfortunately, this suggestion did not produce the result I was hoping for. Chrome does not seem to close in this case. Do you have a link or something that explains the Windows event? I have not used those yet in Rapise.

Statistics
  • Started: Wednesday, March 7, 2018 6:43:11 PM
  • Last Reply: Thursday, March 8, 2018 3:52:24 PM
  • Replies: 2
  • Views: 314