NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

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

try
{
String Payreflink=testData.get("LinkRef");
System.out.println("Payreflink:"+Payreflink);
if (Payreflink.equals("")){

String message="Please provide LinkRef" ;
log.info(message);

DriverScript.bResult="fail";
DriverScript.eMessage=message;
}else if (!Payreflink.equals(""))
{
if(Payreflink.equals("Standalone journey"))
{ //used when user wants to run dependent journey as standalone - In this case user has to provide the Reference value.
String refValue=testData.get("ReferenceValue");
if(refValue==null||refValue.equals(""))
{
String message="Please provide Reference Value" ;
log.info(message);
DriverScript.bResult="fail";
DriverScript.eMessage=message;
}
}
else if(Payreflink.contains("FX"))
{
System.out.println("Integer******** "+Integer.parseInt(testData.get("RowNum")));
System.out.println("Hashmap"+hashmapwithreflinks.get(Payreflink));
String refValue=hashmapwithreflinks.get(Payreflink);
// FX_Deal=testData.get("ReferenceValue");
if(refValue==null||refValue.equals(""))
{
String message="Reference value is not available" ;
DriverScript.bResult="fail";
DriverScript.eMessage=message;
}
else
{
ExcelOperations.setCellData(Constant.TestDataSheetName,"ReferenceValue",hashmapwithreflinks.get(Payreflink),Integer.parseInt(testData.get("RowNum")));
DriverScript.testData.put("ReferenceValue", hashmapwithreflinks.get(Payreflink));

if(testData.get("Fx Type").equalsIgnoreCase("ASSIGN LATER"))
{

FX_Deal=testData.get("ReferenceValue");
System.out.println("FX Deal No:"+FX_Deal);

}


}
}
else
{
System.out.println("Update link ref is not applicable for this journey");
}
}

}
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 Exter_clickNewHashmap(HashMap<String,String> stepDetails, Map<String,String> testData) throws Exception
{
try
{
String data=testData.get("ReferenceValue");
String tempLocatorValue=stepDetails.get("Locator Value");
System.out.println("Data:"+data+" tempLocatorValue:"+tempLocatorValue);
String updatedLocatorValue=tempLocatorValue.replace("Dummy", data);
System.out.println(updatedLocatorValue);
By locator = findByLocator(stepDetails.get("Locator Type"),updatedLocatorValue);
waitForElementToBeClickable(locator,30).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";
DriverScript.eMessage=message;

}
}

public void Exter_clickNewHashmap_Option(HashMap<String,String> stepDetails, Map<String,String> testData) throws Exception
{
try
{
boolean status;

status=Text_verify(stepDetails,testData);

if(status)
{

log.info(""+stepDetails.get("Field Name")+" is enabled");
String data=testData.get("ReferenceValue");
String tempLocatorValue=stepDetails.get("Locator Value");
System.out.println("Data:"+data+" tempLocatorValue:"+tempLocatorValue);
String updatedLocatorValue=tempLocatorValue.replace("Dummy", data);
System.out.println(updatedLocatorValue);
By locator1 = findByLocator(stepDetails.get("Locator Type"),updatedLocatorValue);
waitForElementToBeClickable(locator1, 30).click();

String dealNumber=testData.get("ReferenceValue");
}

}
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 boolean Text_verify(HashMap<String,String> stepDetails, Map<String,String> testData) throws Exception
{
boolean status=false;

try {
WebDriverWait wait= new WebDriverWait(driver,Integer.parseInt(stepDetails.get("WaitTime")));
By locator = findByLocator(stepDetails.get("SupportingElement_1_LocatorType"),stepDetails.get("SupportingElement_1_LocatorValue"));
WebElement ele=wait.until(ExpectedConditions.elementToBeClickable(locator));
status=ele.isDisplayed();

}

catch (Exception e) {
// TODO Auto-generated catch block
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;
}
return status;
}



public void Exter_clicksecondaryaction(HashMap<String,String> stepDetails, Map<String,String> testData) throws Exception
{
try
{
String data=testData.get("ReferenceValue");
String data2 =testData.get(stepDetails.get("Field Name"));
String tempLocatorValue=stepDetails.get("Locator Value");
String updatedLocatorValue=tempLocatorValue.replace("Dummy", data);
updatedLocatorValue=updatedLocatorValue.replace("Temp", data2);
System.out.println("Data:"+data+" tempLocatorValue:"+tempLocatorValue);

System.out.println(updatedLocatorValue);
By locator = findByLocator(stepDetails.get("Locator Type"),updatedLocatorValue);
waitForElementToBeClickable(locator, 30).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";
DriverScript.eMessage=message;

}
}

public void scrollUP(HashMap<String,String> stepDetails, Map<String,String> testData) throws Exception
{
try
{
Robot r=new Robot();
r.keyPress(KeyEvent.VK_CONTROL);
r.keyPress(KeyEvent.VK_HOME);
r.keyRelease(KeyEvent.VK_HOME);
r.keyRelease(KeyEvent.VK_CONTROL);
}
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 input_OptionalField(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException, Exception
{
try
{
String value=testData.get(stepDetails.get("Field Name"));
System.out.println("4 column Invoice Amount:"+value);
System.out.println("Step no"+DriverScript.iTestStep);
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
{
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
WebElement element= waitForElementToBeClickable(locator, 30);
element.clear();
element.sendKeys(value);
}
}
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 Validation_PaymentTypes(HashMap<String,String> stepDetails, Map<String,String> testData) throws MyException, Exception
{
try
{
String value=testData.get(stepDetails.get("Field Name"));
System.out.println("Data :"+value);
System.out.println("Step no"+DriverScript.iTestStep);
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
{
List<String> PaymentTypeList = Arrays.asList(value.split(","));
System.out.println("No of Paymetns in test data"+PaymentTypeList.size());
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
WebElement dd=waitForElementToBeClickable(locator, 50);
List<WebElement> list=dd.findElements(By.xpath("//ul[@class='s2b-options-list ']/li/button/p[@class='s2b-option-lead-text']"));
System.out.println("No of Payment Types in Application"+list.size());
if(PaymentTypeList.size()==list.size())
{
for(int i=0;i<PaymentTypeList.size();i++)
{
System.out.println("Test Data Payment "+PaymentTypeList.get(i));

String PT=null;
for(WebElement temp:list)
{
String str=temp.getText();
System.out.println("Application Payment Type"+str);
//str.equalsIgnoreCase(PaymentTypeList.get(i));

if(str.equalsIgnoreCase(PaymentTypeList.get(i)))
{
PT="TRUE";
break;
}
}
if(PT.equalsIgnoreCase("TRUE"))
{
PT="FALSE";
}
else
{
DriverScript.bResult="fail";
DriverScript.eMessage="Specified payment type not found"+PaymentTypeList.get(i);
break;
}
}
}
else{
String emessage="";
for(WebElement temp:list)
{
String str=temp.getText();
System.out.println("No. of Payments types in Application and Data sheet is not matching "+str);
emessage=emessage+str+",";



}

DriverScript.bResult="fail";
DriverScript.eMessage="Specified payment type not found"+emessage;

}
}
}
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 input_withTABOptionalField(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(stepDetails.get("Field Name")+" is not applicable for this transaction (as per the testData)");
}
else
{
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
WebElement element= waitForElementToBeClickable(locator, 30);
element.clear();
element.sendKeys(value);
Thread.sleep(5000);

Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
Thread.sleep(2000);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
// robot.keyRelease(KeyEvent.VK_TAB);

/*WebElement element1= driver.findElement(By.xpath("//div[@class='row two-col-container']"));
element1.click();

Thread.sleep(5000);
WebElement element2=driver.findElement(By.xpath("//div[@class='large-12 medium-12 small-12 columns s2b-action-bar-component']"));
element2.sendKeys(Keys.TAB,Keys.ENTER);*/
}
}
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 input_with2TABOptionalField(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(stepDetails.get("Field Name")+" is not applicable for this transaction (as per the testData)");
}
else
{
By locator = findByLocator(stepDetails.get("Locator Type"),stepDetails.get("Locator Value"));
WebElement element= waitForElementToBeClickable(locator, 30);
element.clear();
element.sendKeys(value);
Thread.sleep(5000);


Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
Thread.sleep(2000);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
// robot.keyRelease(KeyEvent.VK_TAB);

/*WebElement element1= driver.findElement(By.xpath("//div[@class='row two-col-container']"));
element1.click();

Thread.sleep(5000);
WebElement element2=driver.findElement(By.xpath("//div[@class='large-12 medium-12 small-12 columns s2b-action-bar-component']"));
element2.sendKeys(Keys.TAB,Keys.ENTER);*/
}
}
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.