import oracle.oats.scripting.modules.basic.api.*;
import oracle.oats.scripting.modules.basic.api.exceptions.AbstractScriptException;
import oracle.oats.scripting.modules.browser.api.*;
import oracle.oats.scripting.modules.functionalTest.api.*;
import oracle.oats.scripting.modules.utilities.api.*;
import oracle.oats.scripting.modules.utilities.api.sql.*;
import oracle.oats.scripting.modules.utilities.api.xml.*;
import oracle.oats.scripting.modules.utilities.api.file.*;
import oracle.oats.scripting.modules.webdom.api.*;
import oracle.oats.scripting.modules.formsFT.api.*;
public class script extends IteratingVUserScript {
@ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
@ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;
@ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;
@ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;
@ScriptService oracle.oats.scripting.modules.formsFT.api.FormsService forms;
public void initialize() throws Exception {
browser.launch();
}
/**
* Add code to be executed each iteration for this virtual user.
*/
public void run() throws Exception {
// Navigate to Three Sites and Wait for the Sites to Completely load the page
this.naviagate_site("http://www.yahoo.com");
this.naviagate_site("http://www.google.com");
this.naviagate_site("http://www.gmail.com");
}
public void naviagate_site(String site_name) throws Exception
{
web.window("/web:window[@index='0']").navigate(site_name);
// wait for object /web:window[@index='0' or @title='Yahoo! India']/web:document[@index='0']/web:a
// The Value waitForPage(null) - null uses the default time out from Open Script Preferences
// Got to View > Open Script Preferences
// In the Treeview Navigate to "Open Script > Playback > Web Functional"
// Set timeout to : 20 secs under Object Timeout
web.window("/web:window[@index='0']").waitForPage(null);
}
public void finish() throws Exception {
}
}
No comments:
Post a Comment