NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

public void inputPaymentReference(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException,Exception{

try
{
String paymentReference=testData.get("ReferenceValue");

if(paymentReference==null||paymentReference.equals("")){
String message="Payment Reference is not provided in the excel sheet" ;
log.info(message);
}
else
{
System.out.println("Payment Reference:"+paymentReference);
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
WebElement element= waitForElementToBeClickable(locator, 30);
element.clear();
element.sendKeys(paymentReference);
}
}
catch (Exception e)
{
e.printStackTrace();
String message="The specified data in "+stepDetails.get("Field Name")+" is not found OR "+stepDetails.get("Field Name")+" is not loaded completely after sufficient wait time. Please refer "+testData.get("TestCaseName")+".jpg for more details" ;
log.info(message);
log.info(e.getMessage());
DriverScript.bResult="fail";
DriverScript.eMessage=message;

}
}
public void inputFXDealReference(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException,Exception{

try
{
String FXDealReference=FX_Deal;

if(FXDealReference==null||FXDealReference.equals("")){
String message="Payment Reference is not provided in the excel sheet" ;
log.info(message);
}
else{
System.out.println("Payment Reference:"+FXDealReference);
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
WebElement element= waitForElementToBeClickable(locator, 30);
element.clear();
element.sendKeys(FXDealReference);
}
}
catch (Exception e)
{
e.printStackTrace();
String message="The specified data in "+stepDetails.get("Field Name")+" is not found OR "+stepDetails.get("Field Name")+" is not loaded completely after sufficient wait time. Please refer "+testData.get("TestCaseName")+".jpg for more details" ;
log.info(message);
log.info(e.getMessage());
DriverScript.bResult="fail";
DriverScript.eMessage=message;

}
}

public void validate_PopUp_for_BlankAccountNumbersAndPayeeBank(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException,Exception
{
WebDriverWait wait = new WebDriverWait(driver,Integer.parseInt(stepDetails.get("WaitTime")));

try
{
System.out.println("Payee_Account Number:"+testData.get("Payee_Account Number"));
System.out.println("Payee_Search Bank_BIC CODE:"+testData.get("Payee_Search Bank_BIC CODE"));
if(testData.get("Payee_Account Number").equals("")||testData.get("Payee_Search Bank_BIC CODE").equals("")){
System.out.println("Blank account number or bic code");
String expectedValue=stepDetails.get("ExpectedValue");
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
System.out.println("Actual value:"+driver.findElement(locator).getText() + "expected Value"+expectedValue);
wait.until(ExpectedConditions.textToBe(locator,expectedValue));

}
}
catch (Exception e)
{
e.printStackTrace();
String message = "The specified data in "+ stepDetails.get("Field Name")+ " is not found OR "+ stepDetails.get("Field Name")+ " is not loaded completely after sufficient wait time. Please refer "+ testData.get("TestCaseName")+ ".jpg for more details";
log.info(message);
log.info(e.getMessage());
DriverScript.bResult = "fail";
DriverScript.eMessage = message;
}
}
public void collectTaxDiscountDetails(HashMap<String,String> stepDetails, Map<String,String> testData)
{
if(testData.get("TAX & DISCOUNT(Optional)").equals("yes")||testData.get("TAX & DISCOUNT(Optional)").equals("y"))
{
tax_TYPE=testData.get("TAX TYPE").split(",");;
tax_SUB_TYPE=testData.get("TAX SUB TYPE(Optional)").split(",");
for(int i=0;i<tax_TYPE.length;i++){
System.out.println("tax_TYPE - "+i+":::"+tax_TYPE[i]);
}
for(int i=0;i<tax_SUB_TYPE.length;i++){
System.out.println("tax_SUB_TYPE - "+i+":::"+tax_SUB_TYPE[i]);
}
}
else{
System.out.println("collectTaxDiscountDetails is not applicable for this journey");
}
}
public void input_OptionalField_taxAndDiscount(HashMap<String,String> stepDetails, Map<String,String> testData) throws Exception
{
try
{
String totalValue =testData.get(stepDetails.get("Field Name"));
String value = null;
if(totalValue.equals(null) || totalValue.equals("")|| totalValue.equalsIgnoreCase("NA") ) {
log.info(stepDetails.get("Field Name")+" is not applicable for this transaction (as per the testData)");
}
else{
if(stepDetails.get("Field Name").equalsIgnoreCase("TAX TYPE")){
value= tax_TYPE[currentTaxRecordCount];
}
else if(stepDetails.get("Field Name").equalsIgnoreCase("TAX SUB TYPE(Optional)")){
value= tax_SUB_TYPE[currentTaxRecordCount];
}
System.out.println("value@@@@@@@@@@:"+value);
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
WebElement element= waitForElementToBeVisible(locator, 30);
if(element.isEnabled())
{
element.clear();
element.sendKeys(value);
}
else
{
element.click();
}
//input_MandatoryField(stepDetails, testData);
waitFor(stepDetails, testData);
//Find dropdown list
locator = findByLocator(stepDetails.get("SupportingElement_1_LocatorType"),stepDetails.get("SupportingElement_1_LocatorValue"));
WebElement dd=waitForElementToBeClickable(locator, 50);
List<WebElement> list=dd.findElements(By.tagName("li"));
for(WebElement temp:list)
{
String str=temp.getText();
if(str.contains(value))
{
temp.click();
break;
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
String message="The specified data in "+stepDetails.get("Field Name")+" for INVOICE RECORD-"+currentInvoiceRecordCount+" is not found OR "+stepDetails.get("Field Name")+" is not loaded completely after sufficient wait time. Please refer "+testData.get("TestCaseName")+".jpg for more details" ;
log.info(message);
log.info(e.getMessage());
DriverScript.bResult="fail";
DriverScript.eMessage=message;
}
}
public void multipleTaxAndDiscount_CONTROLLER(HashMap<String,String> stepDetails, Map<String,String> testData)
{
if(testData.get("TAX & DISCOUNT(Optional)").equalsIgnoreCase("yes")||testData.get("TAX & DISCOUNT(Optional)").equalsIgnoreCase("y"))
{
By locator ;
int totalRecordCount=tax_TYPE.length;
System.out.println("totalRecordCount:"+totalRecordCount);
System.out.println("currentRecordCount:"+currentTaxRecordCount);
if(currentTaxRecordCount<totalRecordCount-1)
{
// click on add record button
locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
waitForElementToBeClickable(locator,50).click();

// increment the currentRecordCount
currentTaxRecordCount++;
// decrement the iTestStep to repeat the task
DriverScript.iTestStep=DriverScript.iTestStep-3;
}
}
else{
System.out.println("multipleTaxAndDiscount_CONTROLLER is not applicable for this journey");
}
}

public void collectInvoiceDetails(HashMap<String,String> stepDetails, Map<String,String> testData)
{
invoiceType=testData.get("Invoice Type");
if(!testData.get("Invoice Type").contains("null")||!testData.get("Invoice Type").contains(""))
{
if(invoiceType.contains("4")) // 4 coloum invoice - load all details
{
invoiceAmount=testData.get("4 column Invoice Amount").split(",");;
invoiceReference=testData.get("Invoice Reference").split(",");
invoiceDescription=testData.get("Invoice Description").split(",");
invoiceDate=testData.get("Invoice Date").split(",");

for(int i=0;i<invoiceReference.length;i++){
System.out.println("invoiceReference - "+i+":::"+invoiceReference[i]);
}
for(int i=0;i<invoiceDescription.length;i++){
System.out.println("invoiceDescription - "+i+":::"+invoiceDescription[i]);
}
}
else{
//2 coloum invoice - load all details
invoiceAmount=testData.get("2 column Invoice Amount").split(",");
invoiceDescription=testData.get("Invoice Description").split(",");

for(int i=0;i<invoiceDescription.length;i++){
System.out.println("invoiceDescription - "+i+":::"+invoiceDescription[i]);
}
}
}
else
{
System.out.println("collectInvoiceDetails is not applicable for this journey");
}
}
public void input_OptionalField_Invoices(HashMap<String,String> stepDetails, Map<String,String> testData) throws Exception
{
try
{
String value="",invoiceValues="", updatedLocatorValue="",tempLocatorValue="";
value =testData.get(stepDetails.get("Field Name"));

if(value.equals(null) || value.equals("")|| value.equalsIgnoreCase("NA") ) {
log.info(stepDetails.get("Field Name")+" is not applicable for this transaction (as per the testData)");
}
else{
if(stepDetails.get("Field Name").equalsIgnoreCase("Invoice Reference")){
invoiceValues= invoiceReference[currentInvoiceRecordCount];
}
else if(stepDetails.get("Field Name").equalsIgnoreCase("Invoice Description")){
invoiceValues= invoiceDescription[currentInvoiceRecordCount];
}
else if(stepDetails.get("Field Name").equalsIgnoreCase("2 column Invoice Amount")){
invoiceValues= invoiceAmount[currentInvoiceRecordCount];
}
else if(stepDetails.get("Field Name").equalsIgnoreCase("4 column Invoice Amount")){
invoiceValues= invoiceAmount[currentInvoiceRecordCount];
}

if(invoiceType.contains("2")){
Integer data=currentInvoiceRecordCount+1;
tempLocatorValue=stepDetails.get("Locator Value");
updatedLocatorValue=tempLocatorValue.replace("Dummy", data.toString());
System.out.println("updatedLocatorValue:"+updatedLocatorValue);
}
else{
tempLocatorValue=stepDetails.get("Locator Value");
updatedLocatorValue=tempLocatorValue.replace("Dummy","1");
System.out.println("updatedLocatorValue:"+updatedLocatorValue);
}

By locator = findByLocator(stepDetails.get("Locator Type"),updatedLocatorValue);
WebElement element= waitForElementToBeClickable(locator, 30);
element.clear();
element.sendKeys(invoiceValues);
element.sendKeys(Keys.TAB);

}
}
catch (Exception e)
{
e.printStackTrace();
String message="The specified data in "+stepDetails.get("Field Name")+" for INVOICE RECORD-"+currentInvoiceRecordCount+" is not found OR "+stepDetails.get("Field Name")+" is not loaded completely after sufficient wait time. Please refer "+testData.get("TestCaseName")+".jpg for more details" ;
log.info(message);
log.info(e.getMessage());
DriverScript.bResult="fail";
DriverScript.eMessage=message;

}
}

public void multipleInvoices_CONTROLLER(HashMap<String,String> stepDetails, Map<String,String> testData)
{
if(!testData.get("Invoice Type").contains("null")||!testData.get("Invoice Type").contains(""))
{
By locator ;
int totalRecordCount=invoiceAmount.length;
System.out.println("totalRecordCount:"+totalRecordCount);
System.out.println("currentRecordCount:"+currentInvoiceRecordCount);
if(currentInvoiceRecordCount<totalRecordCount-1)
{
// click on add record button
if(invoiceType.contains("2"))
{
locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
waitForElementToBeClickable(locator,50).click();
}
else{
locator = findByLocator(stepDetails.get("SupportingElement_1_LocatorType"),stepDetails.get("SupportingElement_1_LocatorValue"));
waitForElementToBeClickable(locator,50).click();
}
// increment the currentRecordCount
currentInvoiceRecordCount++;
// decrement the iTestStep to repeat the task
DriverScript.iTestStep=DriverScript.iTestStep-6;

}
else
{
currentInvoiceRecordCount=0;
}
}
else{
System.out.println("multipleInvoices_CONTROLLER is not applicable for this journey");
}
}
public void QuickPayment_Viewpayment_Submitpayment(HashMap<String,String> stepDetails, Map<String,String> testData)
{

boolean PymtFG=false;
try {
By locator;
locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
PymtFG = driver.findElement(locator).isEnabled();
if(PymtFG)
{
driver.findElement(locator).click();
}


}
catch (Exception e)
{
try {
By locator1;
locator1 = findByLocator(stepDetails.get("SupportingElement_1_LocatorType"),stepDetails.get("SupportingElement_1_LocatorValue"));
driver.findElement(locator1).click();
DriverScript.iTestStep = DriverScript.iTestStep +3;
}
catch (Exception e1) {
String message="The specified data in "+stepDetails.get("Field Name")+" for INVOICE RECORD-"+currentInvoiceRecordCount+" is not found OR "+stepDetails.get("Field Name")+" is not loaded completely after sufficient wait time. Please refer "+testData.get("TestCaseName")+".jpg for more details" ;
log.info(message);
log.info(e.getMessage());
DriverScript.bResult="fail";
DriverScript.eMessage=message;
e.printStackTrace();
}

}

}




public void NoOfStepsToskip(HashMap<String,String> stepDetails, Map<String,String> testData)
{
String NofStepstoSkip=stepDetails.get("ExpectedValue");

DriverScript.iTestStep = DriverScript.iTestStep + Integer.parseInt(NofStepstoSkip);

}


}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.