how to compare the collected data with specified data

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

how to compare the collected data with specified data

Naveen Kumar-4
Hey guys,

here i will explain the scenario

in my testing have container it have links but the container is not a table 
- when i used Firepath on link xpath location showed as Ex:-  .//*[@id='23']/td
- same did for below link but the xpath showing as .//*[@id='25']/td

so here the difference if id's not fixed 
for example if user clicked on any link and did some operations then that link will vanished from container.
every link have subject, test case is to compare the specified text with link subject if found test case passed other wiser failed

i have used forloop but the increament method is not fixed so how can i handle this issue ????

int j;
for (j =30; j <= 500; j++) {
// String Trashsubject2= driver.findElement(By.xpath(".//*[@id='sortable']/tbody/tr[" + j + "]/td[3]")).getText();    // path
String Trashsubject= driver.findElement(By.xpath(".//*[@id='" + j + "']/td")).getText();    // path
System.out.println("text Matched  " +Form_name );
System.out.println("row = "+j);

Thank you in advanced

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit
For more options, visit