Skip Navigation LinksHome Page > Forums > Rapise Forums > Rapise Issues & Questions > Closing Chrome Gracefully
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.
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
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.
Hello Pinto18,
I think your RVL script can try this:
Thanks and regards,
Ray
Yeah, use '^{F4}' or '^w' to close only the active tab, and use '%{F4}' to close chrome (or any other) window.
If you use any other combination, don't use {} except for special keys like {TAB}, {ENTER}, {ESCAPE} or similar (see https://www.inflectra.com/Support/KnowledgeBase/KB85.aspx).
And if you have any questions, please email or call us at +1 (202) 558-6885