views:

100

answers:

2

I need to execute the following steps: 1. Start an IE browser window and open a URL (Done using StartBrowser(final string URL) 2. Start a session (done by logging in) 3. Now, I want to enter a different URL in the same browser window which has the same session.

My question is related to Step 3. How can I overwrite the URL in the existing IE window.

Note: I am using a keyword driven framework written in java.

A: 

From the IBM RFT online help: You can use the loadURL() method of the browser object.

If you do not have the browser object already 'learned' into your object map, just record a click on the browser toolbar. Then you can modify that line to be Browser_htmlBrowser().loadURL("http://stackoverflow.com");

Tom E
A: 

Thanks Tom. I agree that loadURL has the implementation to do what I need.

There is one more aspect that may interest others looking at this question, i.e. the way the appropriate browser object is captured. Obviously the easist way is to use the RFT record and click way, and use the appropriate recognition properties or the other way is to implement it is find the existing browseron the fly when the method is called irrespective of recognistion properties etc which may be more useful for some scenarios or frameworks, like it is done below.

RootTestObject root = getRootTestObject(); TestObject[] testobj = root.find(atDescendant(".class", "Html.HtmlBrowser")); BrowserTestObject bto; bto = new BrowserTestObject(testobj[0]); bto.loadUrl(curParamOne);

sjt