Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.openqa.selenium.By;
- import org.openqa.selenium.JavascriptExecutor;
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.WebElement;
- //import EfaPackage.Data;
- //import EfaPackage.Module;
- public class EFAMasterDBNTTEclipse {
- public static void TT_sc01_NTTSearchField(int sc01_caseRow, Data sc01_data)
- {
- String sc01_URL = sc01_data.df_getData(sc01_caseRow, "sc01_URL");
- String sc01_Search = sc01_data.df_getData(sc01_caseRow, "sc01_Search");
- String sc01_output = "";
- String sc01_baseLocator = "org.openqa.selenium.By.";
- Module.cs_executeAction("navigate", sc01_baseLocator + "xpath", "", new String[] {"\"" + sc01_URL + "\""});
- Module.cs_executeAction("sendKeys", sc01_baseLocator + "xpath", "//input[@type='search']", new String[] {sc01_Search});
- Module.cs_executeAction("click", sc01_baseLocator + "xpath", "//input[@type='submit']", new String[] {});
- Module.cs_executeAction("click", sc01_baseLocator + "xpath", "//font[@class='titb']", new String[] {});
- sc01_output = Module.cf_receiveAction("getText", sc01_baseLocator + "xpath", "//p[@class='pseudo-first-child']", new String[] {});
- Module.cf_checkValue(sc01_caseRow, sc01_output , sc01_data);
- }
- public static void TT_sc02_NTTDescriptionField(int sc02_caseRow, Data sc02_data)
- {
- String sc02_URL = sc02_data.df_getData(sc02_caseRow, "sc02_URL");
- //String vSearch = data.getData(caseRow, "vSearch");
- String output = "";
- String baseLocator = "org.openqa.selenium.By.";
- Module.cs_executeAction("navigate", baseLocator + "xpath", "", new String[] {"\"" + sc02_URL + "\""});
- Module.cs_executeAction("click", baseLocator + "xpath", "//span[text()[contains(.,'Industries')]]", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//span[text()[contains(.,'Services')]]", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//span[text()[contains(.,'About NTT DATA')]]", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//span[text()[contains(.,'Insights')]]", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//a[text()[contains(.,'Investor Relations')]]", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//a[text()[contains(.,'CSR')]]", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//a[text()[contains(.,'News Center')]]", new String[] {});
- output = "Windows successfully opened";
- Module.cf_checkValue(sc02_caseRow, output, sc02_data);
- }
- public static void Remedy_Create_Incident(int caseRow, Data data)
- {
- String vRemedyURL = data.df_getData(caseRow, "vRemedyURL");
- String vUsername = data.df_getData(caseRow, "vUsername");
- String vPassword = data.df_getData(caseRow, "vPassword");
- //String vCompany = data.df_getData(caseRow, "vCompany");
- //String vUsername = data.getData(caseRow, "vUsername");
- String output = "";
- String baseLocator = "org.openqa.selenium.By.";
- Module.cs_executeAction("navigate", baseLocator + "xpath", "", new String[] {"\"" + vRemedyURL + "\""});
- Module.cs_executeAction("sendKeys", baseLocator + "xpath", "//input[@type='text']", new String[] {vUsername});
- Module.cs_executeAction("sendKeys", baseLocator + "xpath", "//input[@type='password']", new String[] {vPassword});
- Module.cs_executeAction("click", baseLocator + "xpath", "//input[@name='login']", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//img[@id='reg_img_304316340']", new String[] {});
- Module.cs_executeAction("click", baseLocator + "xpath", "//span[text()[contains(.,'Incident Management')]]", new String[] {});
- //Module.cs_executeAction("click", baseLocator + "xpath", "//span[text()[contains(.,'New Incident')]]", new String[] {});
- WebElement element = ((WebDriver) Module.cv_driver).findElement(By.xpath("//span[text()[contains(.,'New Incident')]]"));
- JavascriptExecutor executor = (JavascriptExecutor)Module.cv_driver;
- executor.executeScript("arguments[0].click();", element);
- try {
- Thread.sleep(500000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //Module.cs_executeAction("click", baseLocator + "xpath", "//span[text()[contains(.,'New Incident')]]", new String[] {});
- //EfaLibrary.executeAction("click", baseLocator + "xpath", "//a[@onclick='javascript:CallARGHPD_58INC_58AppListEntryPointitsm_45arsEPFunc(false, this);']", new String[] {});
- //EfaLibrary.executeAction("click", baseLocator + "xpath", "//div[@class='item EP lvl1 VNavHover1']", new String[] {});
- //Module.cs_executeAction("sendKeys", baseLocator + "xpath", "//textarea[@id='arid_WIN_2_1000000082']", new String[] {vCompany});
- output = "Windows successfully opened";
- Module.cf_checkValue(caseRow, output, data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement