I am a newbie of QTP. Now I want to run my test scripts on IE and Firefox.
Here is the code. IE’s part is ok. But QTP can not open firefox. Anyone can help me? Many thanks.
StartURL = "http://localhost/ekp/servlet/ekp/login?getnews=Y"
‘ I want to parameter this first URL later on.
IF Browser ="IE" Then
Set MyBrowser = CreateObject("InternetExplorer.Application")
MyBrowser.Visible = True
If Browser ="FireFox" Then
Set MyBrowser = CreateObject("QuickTest.Application")
MyBrowser.Test.Settings.Launchers("Web").Active = True
MyBrowser.Test.Settings.Launchers("Web").Browser = "FF20"
MyBrowser.Test.Settings.Launchers("Web").Address = StartURL
'MyBrowser.Test.Settings.Launchers("Web").CloseOnE xit = True
Actualy you are doing it wrongly. The SetupBrowser function should be a global VBS file associated in the text file and in that file only you need to decide which browser should QTP open. You can't run this code through an action because it would be too late for QTP to check these settings and open a browser.