How to close an application window in Perl automation? - perl

I have an automation which opens many applications. I want to close all the opened windows at the end of the execution. I know I can use SendKeys(%F4); But I Don't want to use send keys function. Is there any other way closing an window.??
If any please let me know...
Thanks in advance... :)

Click here which says CloseWindow $HWND Sends close signal to a window.

Use the following code.
MenuSelect("&Close", 0, GetSystemMenu(HWND, FALSE));
Which gets the default(System) menu which one can get by clicking the top left of the title bar, and makes the select operation on close.

Related

Tcl/Tk grab a window globally

My Tk application has a main window, when executing, new window arises to show the running progress. I want all the events (mouse, keyboard, etc) are directed to the progress window, so when program is runned, user cannot interact with the main window, and must wait until execution is done and progress window destroyed.
I tried using grab to handle this.
grab set .progress_window
But it doesn't work. The progress window still disappears when mouse clicked somewhere outside it.
grab set -global .progress_window seems work but it block all the other windows running on my computer.
How to solve this problem?
Thank you so much.
You might need this too to keep it on top:
wm transient .progress_window .
Also, see how Tk itself creates modal dialogs.
There are some hoops to go through to get it fully right, e.g.:
https://github.com/tcltk/tk/blob/master/library/dialog.tcl

Error-timeout after 30000ms in Selenium IDE

I want to open a pop up (panel) using ADD button but I am getting time out even with setting- settimeout-30000/600000/1200000 and also using waitforpagetoload function with the same time as I mentioned for settimeout.
Anyone help ?
Change configuration in Selenium IDE. Click on menu, Options->options->In general Tab give 60,000 or above in Default Timeout Textbox.
As you said waitforpagetoload is not working for you.
Try using pause command, that might help you.
I think the problem you are having is that the script doesn't recognize the popup and also the ide get stuck. if that is the case,
This happened to me several times. This is happening because a popup can't be located by the script. You have to use a locate the frame of the popup and get it's id.
try using:- WebElement frame = driver.findElement(By.tagName("iframe"));
(iframe should be the id of the frame you take from the ide)
hope this would help.
Slow down the speed of your test to run. Probably Selenium doesn't have enough time to catch the element

Auto Left Click on Hold?

I want my mouse to rapidly autoclick when I hold the left mouse button, how can I do this?
I have searched for hours, I didn't find anything!
Thanks in advance.
EDIT: P.S.: I want the rapid click to stop as soon as I release the left button.
Can you be slightly more specific? Are you trying to write out the program of just finding an auto clicker application?
If you are looking for the application only, then there is alot available online. Just google. One such application could be: http://auto-clicker-by-shocker.soft32.com/
If you are trying to write a program, its pretty simple too, but you need to let me know what language you are using, if its OOP, I should be able to help.
Nevermind, I made an AutoHotKey script:
Suspend, On
~XButton2::Suspend, Toggle
~LButton::
While GetKeyState("LButton", "P"){
Click
Sleep 50 ; milliseconds
}
return

Adjust MatLab window focus

I've done some searching regarding this question but no luck so far, and I'm hoping somene here can help me out.
I'm using MatLab's Editor, but when I run the program, the console is in the main window. Is there a way I can make MatLab open its main window just below the Editor window?
For example, I'm on Chrome and then I open the Editor and run the program. But the main window is still hidden below Chrome. Is there any way I can configure it so that any time I open any MatLab window it makes sure that the main window is below that one?
Please let me know if I didn't make myself clear, and sorry for bad english!
Thanks in advance
It sounds like you want to "dock" your window.
There is a little curly arrow in the top right hand corner of each window (pointing to the right and down when the window is floating, if I recall correctly). If I understand your question correctly, that would solve it for you..

How to capture commandline output

I want to run
"runas /user:xxxx "aspnet_regiis /i"
in my windows 2008 server, it failed with a quick popup window disappears right away.
How can I capture the output? or let the popup window not disappear right away until I close it.
Thank you very much.
Issue resolved, all I need is to see the output which has some error message. I run as the cmd and get the right privilege and everything is fine.
Thanks for replying.