run error for systemutil.run "iexplore.exe"

616 views
Skip to first unread message

Sujay Kumar

unread,
Jun 6, 2012, 1:29:44 AM6/6/12
to qtp-ele...@googlegroups.com, QTP Selenium Elearn Sales
Hi,
 
I am using simple code  systemutil.Run  "iexplore.exe"  but getting follwoing error
 
Invalid procedure call or argument
Line(1): "systemutil.Run "iexplore.exe"
 
It is not opening my internet browser. I am using window vista.
Please suggest what can be problem here.
 
Thanks and Regards
Sujay

prasad gudla

unread,
Jun 6, 2012, 4:25:29 AM6/6/12
to Sujay Kumar, qtp-ele...@googlegroups.com, QTP Selenium Elearn Sales
Please understand the error message.
The arguments passed to the procedure is not correct, meaning it is expected more number of arguments
so try something like this and see 

SystemUtil.Run "IExplore.exe", "www.google.com"

--
Thanks & Regards,
Prasad Gudla

Jitendra.S

unread,
Jun 6, 2012, 10:55:50 AM6/6/12
to qtp-ele...@googlegroups.com, QTP Selenium Elearn Sales
@Jay and Prasad,

It should work with   SystemUtil.Run  "iexplore.exe" ..
It  working with QTP10/11 with win-7.. I think problem is in other line of codes even-though it showing for Line 1..Jay,Please share entire code where you got this error..

[params], [dir], [op], [mode] are optional so it should work ..Only file name compulsory so  (you can check below i.e help option of SystemUtil )...

Description
Runs a file or application.

Important Information

When specifying a non-executable file, the file opens in the associated application.

Note: A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a test.

Tip: You can also use this method to perform operations on the specified file, similar to the usage of the Windows ShellExecute command.

Syntax

object.Run file, [params], [dir], [op], [mode]

Syntax Details

Argument Description
object A test object of type SystemUtil.
file Required. A String value.
The name of the file you want to run.

params Optional. A String value.
If the specified file argument is an executable file, use the params argument to specify any parameters to be passed to the application.
dir Optional. A String value.
The default directory of the application or file.
op Optional. A String value. The action to be performed. If this argument is blank ( ""), the open operation is performed.
The following operations can be specified for the op argument:

Operation

Description

open
Opens the file specified by the FileName parameter. The file can be an executable file, a document file, or a folder. Non-executable files are open in the associated application.
edit
Launches an editor and opens the document for editing. If the FileName argument does not specify an editable document file, the statement fails.
explore
Explores the folder specified by the FileName argument.
find
Initiates a search starting from the specified folder path.
print
Prints the document file specified by the FileName argument. If the specified file is not a printable document file, the statement fails.
mode Optional. An Integer value.

Specifies how the application is displayed when it opens. You can specify one of the modes in the table below.
Default = 1

Mode

Description

0
Hides the window and activates another window.
1
Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. Specify this flag when displaying the window for the first time.
2
Activates the window and displays it as a minimized window.
3
Activates the window and displays it as a maximized window.
4
Displays the window in its most recent size and position. The active window remains active.
5
Activates the window and displays it in its current size and position.
6
Minimizes the specified window and activates the next top-level window in the Z order.
7
Displays the window as a minimized window. The active window remains active.
8
Displays the window in its current state. The active window remains active.
9
Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. Specify this flag when restoring a minimized window.
10
Sets the show-state based on the state of the program that started the application.

Return Type

None

Example


~J~



Sujay Kumar

unread,
Jun 6, 2012, 11:13:36 PM6/6/12
to prasad gudla, qtp-ele...@googlegroups.com, QTP Selenium Elearn Sales
Not working even if I write code like 
SystemUtil.Run "IExplore.exe", "www.google.com"
 
 
If you try with window vista you would get the same error.
I tried in window XP  and it does work.
 
Can anybody suggest how should we open the IE browser in vista using systemutil.run ? 
 
Thanks and Regards
Sujay Kumar

Sujay Kumar

unread,
Jun 6, 2012, 11:36:18 PM6/6/12
to prasad gudla, qtp-ele...@googlegroups.com, QTP Selenium Elearn Sales
ok guys. I found a way by searching on google.
here is the solution
 
systemutil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE", "www.mail.yahoo.com"
 
 
Thank you all who responded.
Reply all
Reply to author
Forward
0 new messages