TestComplete:How to run Run dialog box through C# scripting in Testcomplete? - testcomplete

In one of my tests, i need to open Run Dialog Box and open an application.
How can i open 'Run' in the very first step using C# script in Testcomplete.
Thanks in Advance

Helen is right: the best way is to just use the Tested Applications feature. However, if you must use the Run dialog for some reason, you can open it using this code of line:
Sys.Keys("[Hold][Win]r[Release]");

Related

VB script to open .exe file and perform 4 activities

I have a tool based on .net. I need a vb script which would open this tool (.exe file) and then select 3 radio buttons, click on a button to browse a xml file stored in same folder and then click on invoke button. Is this possible? I am a complete fresher and just have this idea in mind for an automation. This is required as I have to perform the same steps daily.
I could find this code:
CreateObject("WScript.Shell").Run("""C:\Users\abc\Desktop\folder\Tool.exe""")
Which is doing my task to open the .exe file perfectly. Can someone help/guide me in achieving the further steps?
You might be better off making your tool work via the command line and having it accept arguments.
That way, you could use a .bat file to call your 'tool' passing in the arguments it needs and away you go.
These should get you started on your quest.
Creating a HelloWorld Console Application Using VisualBasic.NET
How to Parse Command Line Parameters?
What is a bat file

How to handle File Download pop up in Firefox using AutoIT in (selenium RC)

I need to download a file from application in my selenium RC test.
When i click on the link/button to save a file, first i get a pop up which asks me to either open or save the file, when i select 'Save' and click 'OK' then i get one more pop up asking me to provide the path where file is to be saved and file name also.
I goggled and found that this could be done via AutoIT but i am facing some problems while doing that.
so could some one please provide me the .exe file for file_download in Firefox and also where i can mention the path to save that file too.
and also if you could provide me what exactly the code, i need to write in my test case.
Please let me know how to handle this.
You can achieve that without using autoit also. follow below steps.
Create new firefox profile.
Change the preferences in that profile manually before starting the automation with that profile. (Change the settings like below)
Now start the automation using that profile so that files will be downloaded to default location.
Starting selenium server using specfic profile
java -jar selenium-server.jar -firefoxProfileTemplate "C:\Users\UserName\AppData\Roaming\Mozilla\Firefox\Profiles\234saddsf.customProfile"
I found this link: http://qtp-help.blogspot.com/2009/07/selenium-handle-dialogs.html
Unfortunately it is for the old style dialog boxes that do not have the open vs save radio buttons. I'm searching for a solution to this part of the problem.

VBScript - create button in the notepad window

Using VBScript, I want to add an additional button to Notepad labeled “send” . The send button should be located near the help menu in the Notepad window
Please advise if it is possible to add a button inside Notepad. And if it possible then how can I create the button using VBScript?
Note - why I need to add the send button: The purpose of the send button is to send the file opened in Notepad to a remote Linux machine over the network.
This is not possible with VBScript. You could possibly manage to add the button, but you couldn't hook anything to respond to it being clicked.
You could probably hack something together using the native Win32 API, but it's more work to do that than it would be to write your own simple editor in any other language and use it instead of Notepad. (Notepad is simply a thin wrapper around a multiline edit control provided by the Windows API.)
It's Impossible via VBScript but with help of more serious languages like c# or c++ freely:
for example see project of my friend:
http://www.codeproject.com/KB/COM/automatingwindowsapps.aspx

How to open the Run window programmatically

Everyone knows the Run window that you can open with the shortcut Windows+R or directly in the Windows menu then Run.
I'm wondering how to open this Run window programmatically.
This window seems to be part of explorer.exe.
Does anyone have an idea on it ?
You can use IShellDispatch::FileRun to achieve this.
See Using the Windows RunFile dialog - The documented and undocumented way for details and sample code.
If you mean that it could open say at 8:00 am, then you can use autohotkey and simply write
SendInput {Raw}{Lwin}{R}
and then compile it as an .exe and put it as a cron job

Web page download automation in vbscript

How would you automate logging into a website and downloading a page using vbscript?
Using the MSXML.XMLHTTP-object to first do a POST to login and then add the cookie-headers to a GET request.
As a quick and dirty solution, you could use a Shell object with SendKeys and Run as demonstrated here. These functions are quite powerful for those situations where you just can't the right object or library to use...
Well the script (given on link )works fine if you open the notepad and don't change the focus to other window.
If you change the focus above script doesn't work.

Resources