Reputation: 711
import resources.Script4Helper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.WPF.*;
import com.rational.test.ft.object.interfaces.dojo.*;
import com.rational.test.ft.object.interfaces.siebel.*;
import com.rational.test.ft.object.interfaces.flex.*;
import com.rational.test.ft.object.interfaces.generichtmlsubdomain.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
import com.ibm.rational.test.ft.object.interfaces.sapwebportal.*;
public class Script4 extends Script4Helper
{
public void testMain(Object[] args)
{
setSimplifiedScriptLine(1); //firefox.exe: Mozilla Firefox Start Page - Mozilla Firefox
timerStart("firefoxexeMozillaFirefoxStartPageMozilla_1");
setSimplifiedScriptLine(2); //Click Mozilla Firefox Start Page - Mozilla Firefox Index 17
mozillaFirefoxStartPageMozilla().click(atIndex(17),atPoint(257,55));
setSimplifiedScriptLine(3); //Type Value google.com{ENTER}
mozillaFirefoxStartPageMozilla2().inputKeys("google.com{ENTER}");
timerStop("firefoxexeMozillaFirefoxStartPageMozilla_1");
}
}
How to run this script? When i run this, this does not open the browser. It says "could not find mozilla"..
Can someone help with this??
Upvotes: 1
Views: 648
Reputation: 4695
Follow this guide on how to configure Mozilla Firefox.
http://www.xcarecrows.com/eclipse/doc/Xcarecrows4SMV/current_version/html/userGuide/RFT%20-%20configure%20mozilla.html
Note that you have to use very old Firefox Versions (up to 3.6). In your code you have to start the app by name using startApp("Firefox");
before doing any action in the browser.
I suggest to disable the Simplified Scripting, as it's very annoying https://stackoverflow.com/a/12243216/423955
Upvotes: 0
Reputation: 752
In the script I don't see any statement that says start Browser or start Application.
Also, it seems the browser is not enabled and the html controls are getting recognised as windows controls.
In RFT you can use Simplified Scripting (that you are using currently) , and also Java scripting. This can be configured in the preferences. Or with the new version of RFT it can also be selected while creating a script.
You can manually edit the script to insert code snippet to start the browser. RFT help would have the documentation on startBrowser()and startApp() APIs .
-Hope it helps.
Upvotes: 0