Selenium/winapp driver reading data from property file

The name of the picture


Selenium/winapp driver reading data from property file



I'm trying to automate through winapp driver, where I'm keeping coordinates in config file and created method where I can read that property file but I'm not able to read that values instead of values it is printing 0,0.


public static void coordinates(int point ,int x,int y) {
switch(point) {
case 2 :
String xy = prop.getProperty("2_point").split(",");
System.out.println(xy);

int x1=Integer.valueOf (xy[0]);
int y1=Integer.valueOf (xy[1]);
break;
case 3:
String xy1 = prop.getProperty("3_point").split(",");

int x2=Integer.valueOf (xy1[0]);
int y2=Integer.valueOf (xy1[1]);
break;
case 4:
String xy2 = prop.getProperty("4_point").split(",");

int x3=Integer.valueOf (xy2[0]);
int y3=Integer.valueOf (xy2[1]);
break;
}
}



I'm keeping this coordinates in config.property file:



And I'm calling that method as shown below:


Action = new Actions(AppSession);
court=AppSession.findElementByAccessibilityId("picCourt");
coordinates(point,x,y);
System.out.println(x);
System.out.println(y);

switch(point) {
case 2 :
action.moveToElement(court, x1, y1).click().perform();
System.out.println(x1);
System.out.println(y1);
break;
case 3:
action.moveToElement(court, x2, y2).click().perform();
break;
case 4:
action.moveToElement(court, x3, y3).click().perform();
break;
}



But when I printed x y coordinates printing as 0,0 instead of that values which I passed in config file.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Stripe::AuthenticationError No API key provided. Set your API key using “Stripe.api_key = ”

CRM reporting Extension - SSRS instance is blank

Keycloak server returning user_not_found error when user is already imported with LDAP