NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

public void ReportDatePicker(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException,Exception
{
try
{
String value=testData.get(stepDetails.get("Field Name"));
if(value.equals(null) || value.equals("")|| value.equalsIgnoreCase("NA") ) {
log.info(value+" is not applicable for this transaction (as per the testData)");
}
else
{
System.out.println("In Date picker");
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
System.out.println("Locator value"+stepDetails.get("Locator Type")+stepDetails.get("Locator Value"));
WebElement element= waitForElementToBeClickable(locator,60);
element.click();
System.out.println("Calender Clicked");
//element.sendKeys(Keys.PAGE_UP);

// Robot robot = new Robot();
// robot.keyPress(KeyEvent.VK_PAGE_UP);
// robot.keyRelease(KeyEvent.VK_PAGE_UP);

/*//ZOOM IN
System.out.println("in zoom");
Thread.sleep(3000);
WebElement ele= driver.findElement(By.xpath("//label[text()='PAYMENT SCHEDULE']"));
ele.sendKeys(Keys.CONTROL,Keys.SUBTRACT);
Thread.sleep(2000);
ele.sendKeys(Keys.CONTROL,Keys.SUBTRACT);
Thread.sleep(2000);
ele.sendKeys(Keys.CONTROL,Keys.SUBTRACT);
Thread.sleep(2000);
element.sendKeys(Keys.CONTROL,Keys.SUBTRACT);
Thread.sleep(2000);*/



String Payment_date = testData.get(stepDetails.get("Field Name"));
System.out.println("Payment_date"+Payment_date);
Date initDate = new SimpleDateFormat("dd/MM/yyyy").parse(Payment_date);
System.out.println("initDate"+initDate);
SimpleDateFormat formatter1 = new SimpleDateFormat("dd-MMM-yyyy");
String parsedDate = formatter1.format(initDate);
System.out.println("Value Date:"+parsedDate);
String input=null;
String inputdate=null;

input = parsedDate.substring(3, 6);
System.out.println("input"+input);
inputdate = parsedDate.substring(0, 2);
System.out.println("inputdate"+inputdate);
String printDate=parsedDate.substring(0,1);
System.out.println("printDate"+printDate);

if(printDate.equals("0"))
{
inputdate=parsedDate.substring(1, 2);
}
waitFor(stepDetails, testData);

System.out.println("Click on Month");

By locator1 = findByLocator(stepDetails.get("SupportingElement_1_LocatorType"),stepDetails.get("SupportingElement_1_LocatorValue"));
WebElement element1= waitForElementToBeClickable(locator1, 30);
element1.click();

By locator2 =findByLocator(stepDetails.get("SupportingElement_2_LocatorType"),stepDetails.get("SupportingElement_2_LocatorValue"));
WebElement element2= waitForElementToBeClickable(locator2, 30);
System.out.println("Waited for element2");
By locator3 = findByLocator(stepDetails.get("SupportingElement_3_LocatorType"),stepDetails.get("SupportingElement_3_LocatorValue"));
System.out.println("Waited for locator3");
List<WebElement> columns = element2.findElements(locator3);
for (WebElement cell : columns) {
System.out.println("cell values :"+cell.getText());
if (cell.getText().equals(input)) {
System.out.println("Cell"+cell.getText());
cell.click();
break;
}
}

By locator4 =findByLocator(stepDetails.get("SupportingElement_4_LocatorType"),stepDetails.get("SupportingElement_4_LocatorValue"));
WebElement element4= waitForElementToBeClickable(locator4, 30);
System.out.println("Waited for element4"+stepDetails.get("SupportingElement_4_LocatorType")+stepDetails.get("SupportingElement_4_LocatorValue"));
By locator5 = findByLocator(stepDetails.get("SupportingElement_5_LocatorType"),stepDetails.get("SupportingElement_5_LocatorValue"));
System.out.println("Waited for element5"+stepDetails.get("SupportingElement_5_LocatorType")+stepDetails.get("SupportingElement_5_LocatorValue"));
System.out.println("Waited for locator5");
List<WebElement> columns1 = element4.findElements(locator5);
System.out.println("List Size"+columns1.size());
System.out.println("input"+inputdate);
for (WebElement cell1 : columns1)
{
//System.out.println("In For Loop");
System.out.println("cell values :"+cell1.getText());
if (cell1.getText().equals(inputdate)) {
System.out.println("Cell"+cell1.getText());
cell1.click();
break;
}
}
/* // SET ZOOM 100%
element.sendKeys(Keys.CONTROL,"0");*/
}


}
catch (Exception e)
{
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 menuClick_LaunchURL(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException,Exception
{
try
{
int waitTime=Integer.parseInt(stepDetails.get("WaitTime"));
WebDriverWait wait = new WebDriverWait(driver,waitTime);
WebElement element=null;

clickSupportingElement(stepDetails.get("SupportingElement_1_LocatorType"),stepDetails.get("SupportingElement_1_LocatorValue"));
System.out.println("Supporting element clicked");

By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
element=wait.until(ExpectedConditions.elementToBeClickable(locator));
element.click();
System.out.println("element found");
System.out.println("Main element clicked");
}
catch (Exception e)
{
System.out.println("Flag:"+DriverScript.flag);
if(DriverScript.flag)
{
DriverScript.iTestStep=DriverScript.iTestStep-9;
System.out.println("Re hitting the Browser");
}
else
{
e.printStackTrace();
String message="Failed to launch URL";
log.info(message);
log.info(e.getMessage());
DriverScript.bResult="fail";
DriverScript.eMessage=message;
}
}
}
public void clickSupportingElement(String LocatorType,String LocatorValue) throws Exception
{
try
{
Thread.sleep(2000);
By locator = findByLocator(LocatorType,LocatorValue);
waitForElementToBeClickable(locator,50).click();
}
catch (Exception e) {
e.printStackTrace();
}
}

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

try
{
String Payment_date = testData.get(stepDetails.get("Field Name"));

if(Payment_date.equals(null) || Payment_date.equals("")|| Payment_date.equalsIgnoreCase("NA") )
{
log.info(stepDetails.get("Field Name")+" is not applicable for this transaction (as per the testData)");
}
else
{

System.out.println("Payment_date"+Payment_date);
Date initDate = new SimpleDateFormat("dd/MM/yyyy").parse(Payment_date);
System.out.println("initDate"+initDate);
SimpleDateFormat formatter1 = new SimpleDateFormat("dd-MMM-yyyy");
String parsedDate = formatter1.format(initDate);
System.out.println("Value Date:"+parsedDate);
String input=null;
String inputdate=null;

input = parsedDate.substring(3, 6);
System.out.println("input"+input);
inputdate = parsedDate.substring(0, 2);
System.out.println("inputdate"+inputdate);
String printDate=parsedDate.substring(0,1);
System.out.println("printDate"+printDate);

if(printDate.equals("0"))
{
inputdate=parsedDate.substring(1, 2);
}
String Temp=inputdate+" "+input;
String tempLocatorValue=stepDetails.get("Locator Value");
String updatedLocatorValue=tempLocatorValue.replace("Dummy", Temp);
By locator = findByLocator(stepDetails.get("Locator Type"),updatedLocatorValue);
waitForElementToBeClickable(locator, 50).click();
}

}
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";
}
}
public void verify_continue_save_cancel(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException,Exception{
try
{
String data=testData.get(stepDetails.get("Field Name"));
String tempLocatorValue=stepDetails.get("Locator Value");
String updatedLocatorValue=tempLocatorValue.replace("Dummy", data);
By locator = findByLocator(stepDetails.get("Locator Type"),updatedLocatorValue);
waitForElementToBeClickable(locator,50).click();
System.out.println("In Save and close"+DriverScript.iTestStep);
if(data.equalsIgnoreCase("Save & Close"))
{
System.out.println("In Save and close"+DriverScript.iTestStep);
DriverScript.iTestStep= DriverScript.iTestStep+5;
System.out.println("step"+DriverScript.iTestStep);
}
else if(data.equalsIgnoreCase("CANCEL"))
{

By locator1 = findByLocator(stepDetails.get("SupportingElement_1_LocatorType"),stepDetails.get("SupportingElement_1_LocatorValue"));
WebElement element1= waitForElementToBeClickable(locator1, 30);
element1.click();
System.out.println("@cancel");
DriverScript.bResult="forceEnd";

}
}
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 verify_PaymentStatus(HashMap<String,String> stepDetails, Map<String,String> testData){
try
{
String status= fetchingthestatus_Varible(stepDetails, testData);
System.out.println("In verify_PaymentStatus");
System.out.println("Status:"+status);

if(status.equalsIgnoreCase("Completed")||status.equalsIgnoreCase("Draft"))
{
DriverScript.bResult="forceEnd";
//If payment journey will end if the payment status is complete or Draft
}

}
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;
}

}
     
 
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.