use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class SeleniumRobotTestPlan method loadUftScript.
/**
* Load a UFT script locally or remotely via a VBS script called through csscript.exe
* @param almServer ALM server address
* @param almUser
* @param almPassword
* @param almDomain
* @param almProject
* @param scriptPath path to ALM script. e.g: '[QualityCenter]Subject\TOOLS\TestsFoo\foo'
* @param killUftOnStartup if true, UFT will be killed before starting the UFT test
*/
public Uft loadUftScript(String almServer, String almUser, String almPassword, String almDomain, String almProject, String scriptPath, boolean killUftOnStartup) {
Uft uft = new Uft(almServer, almUser, almPassword, almDomain, almProject, scriptPath);
uft.loadScript(killUftOnStartup);
return uft;
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestSeleniumRobotTestPlan method testLoadUftScript.
@Test(groups = { "ut" })
public void testLoadUftScript() throws Exception {
PowerMockito.whenNew(Uft.class).withAnyArguments().thenReturn(uft);
Uft uftInstance = new SeleniumRobotTestPlan().loadUftScript("", "", "", "", "", "", false);
Assert.assertEquals(uftInstance, uft);
verify(uft).loadScript(false);
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testPrepareArgumentsWithAlmTest.
/**
* Check we add ALM parameters if they are set
*/
@Test(groups = { "ut" })
public void testPrepareArgumentsWithAlmTest() {
Uft uft = new Uft("http://almserver/qcbin", "usr", "pwd", "dom", "proj", "[QualityCenter]Subject\\Tools\\Tests\\test1");
uft.setKillUftOnStartup(false);
List<String> args = uft.prepareArguments(true, true);
Assert.assertEquals(args.size(), 9);
Assert.assertTrue(args.get(0).startsWith(System.getProperty("java.io.tmpdir")));
Assert.assertTrue(args.get(0).endsWith("uft.vbs"));
Assert.assertTrue(args.get(1).equals("[QualityCenter]Subject\\Tools\\Tests\\test1"));
Assert.assertTrue(args.get(2).equals("/execute"));
Assert.assertTrue(args.get(3).equals("/server:http://almserver/qcbin"));
Assert.assertTrue(args.get(4).equals("/user:usr"));
Assert.assertTrue(args.get(5).equals("/password:pwd"));
Assert.assertTrue(args.get(6).equals("/domain:dom"));
Assert.assertTrue(args.get(7).equals("/project:proj"));
Assert.assertTrue(args.get(8).equals("/load"));
;
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testPrepareExecutionArgumentsWithAlmTest.
/**
* Check we do not add ALM parameters if they are set on execution
*/
@Test(groups = { "ut" })
public void testPrepareExecutionArgumentsWithAlmTest() {
Uft uft = new Uft("http://almserver/qcbin", "usr", "pwd", "dom", "proj", "[QualityCenter]Subject\\Tools\\Tests\\test1");
uft.setKillUftOnStartup(false);
List<String> args = uft.prepareArguments(true, false);
Assert.assertEquals(args.size(), 8);
Assert.assertTrue(args.get(0).startsWith(System.getProperty("java.io.tmpdir")));
Assert.assertTrue(args.get(0).endsWith("uft.vbs"));
Assert.assertTrue(args.get(1).equals("[QualityCenter]Subject\\Tools\\Tests\\test1"));
Assert.assertTrue(args.get(2).equals("/server:http://almserver/qcbin"));
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testReadReportListActions.
@Test(groups = { "ut" })
public void testReadReportListActions() throws IOException, DataConversionException {
String report = GenericTest.readResourceToString("tu/Results.xml");
Uft uft = new Uft("[QualityCenter]Subject\\Tools\\Tests\\test1");
List<TestStep> stepList = uft.readXmlResult(report);
// check all content has been read
Assert.assertEquals(stepList.size(), 2);
Assert.assertEquals(stepList.get(0).getName(), "UFT: DebutTest [DebutTest]");
Assert.assertEquals(stepList.get(1).getName(), "UFT: Choixproduit [Choixproduit]");
// check the while content
Assert.assertEquals(stepList.get(0).getStepStatus(), StepStatus.FAILED);
Assert.assertEquals(stepList.get(1).getStepStatus(), StepStatus.SUCCESS);
Assert.assertEquals(stepList.get(1).toString(), "Step UFT: Choixproduit [Choixproduit]\n" + " - Choix du produit\n" + " : Permet de sélectionner le produit à traiter dans l'arbre produit\n" + " - Step P9\n" + " : Local Browser\n" + " - Step P9 - Agence\n" + " : Page\n" + " - Step Onglets\n" + " : Frame\n" + " - Particulier.Exist\n" + " : \"Object does not exist\"\n" + " - Step Menu\n" + " : Frame\n" + " - Assurance.Click\n" + " :");
}
Aggregations