0

I used this xpath locator: //table/following::div[text()='value']/preceding::span[@class='x-grid-checkcolumn'][1]"}

on the page i scripted as:

public void selectTestPlan(String value) {
            String[] path = {ChatTestingPagePath2.ChatTestManagement.TEST_PLAN_CHECKBOX[0].replace("{value}", value),ChatTestingPagePath2.ChatTestManagement.TEST_PLAN_CHECKBOX[1]};
            click(path);
        }

but it always failed, it says that it was unable to locate the element.

Hoping for your response.

Thank you!

However when changing the value in specific value like this:

//table/following::div[text()='Testing']/preceding::span[@class='x-grid-checkcolumn'][1]"}

and use the page as:

public void selectTestPlan() {
            String[] path = {ChatTestingPagePath2.ChatTestManagement.TEST_PLAN_CHECKBOX[0], value),ChatTestingPagePath2.ChatTestManagement.TEST_PLAN_CHECKBOX[1]};
            click(path);
        }

it will passed the automated test.

Mae
  • 1
  • 1

1 Answers1

0

This should work:

public void selectTestPlan(String value) {

        String path = "//table/following::div[text()='%s'] preceding::span[@class='x-grid-checkcolumn'][1]";

        click(String.format(path, value));
    }

I hope it helps!

bkr_man
  • 1
  • 1