I am doing automation for windows application with winapp driver tool.
I am the with . If it matches read the value property file data

config.property file –>X, Y co ordinates

2_point=100,160

3_point=200,200

4_point=62,199

HashMap< String, String > propMap = new HashMap< String, String >();
                    String[] xy = prop.getProperty("2_point").split(",");
                    String[] xy1 = prop.getProperty("3_point").split(",");
                    String[] xy2 = prop.getProperty("4_point").split(",");
                    Enumeration< Object > keysEnum = prop.keys();

                    // Looping over the elements of Enumeration
                    while(keysEnum.hasMoreElements())
                    {
                        // Extracting the key and respective values from it.
                        String propKey = (String)keysEnum.nextElement();
                        String propValue = (String)prop.getProperty(propKey);

                        // After extracting the key and value from the properties file
                        // we will store the values in a HashMap.
                        propMap.put( propKey.toLowerCase().trim(),propValue.toLowerCase().trim());

                    }    


                    int x_coorinate=Integer.parseInt(xy[0]);
                    int y_coorinate=Integer.parseInt(xy[1]);

 String s1="2_point";
                    String s2="3_point";
                    String s3="4_point";
                    int p =(int)event.getRow(i).getCell(5).getNumericCellValue();
                    if((s1==p)||(s2==p)||(s3==p))

                    {
}

Here I’m just creating a enumeration to store all the key of property file
and iterate. Now I need to compare with excel data.
in excel column , I written as 2_point as ‘2’ , 3_point as ‘3’ , 4_point as ‘4’

anybody please check my code..that i tried is correct or not ?



Source link https://sqa.stackexchange.com/questions/34874/comparing-excel-data-with-property-file-key

LEAVE A REPLY

Please enter your comment!
Please enter your name here