Issue
I want to automate a scenario in which multiple products needs to be asserted with respect to filter values from a ecommerce website. I want to know what could be the approach which we can implement using selenium?
Solution
hi plz try like below
public class ComparingItems {
public static void main(String[] args) {
// Multiple products
String mProducts[] = {"Reebok","addidas","puma"};
// filter values from e commerce website
String eProducts[] = {"Reebok","Fila","puma"};
// now how to assert the two use below logic
for(int i=0;i< mProducts.length;i++){
Assert.assertEquals(mProducts[i], eProducts[i], "Item Not matched");
}
}
}
Answered By - Rajnish Kumar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.