Xpath with combination of Preceding-sibling and following-sibling

前端 未结 2 1509
不知归路
不知归路 2021-01-26 06:30

I am trying to read the values from this screen( Sections appears dynamically it can be more than one). We have to read each field like Local Radios, MAC Address, Version from G

2条回答
  •  不知归路
    2021-01-26 07:19

    To retrieve each field like Local Radios, MAC Address, Version from General Application Statistic and the field Default Geo Code from Legacy Configuration you can use the following code block :

    List all_items1 = driver.findElements(By.xpath("//table[@class='tabletext']/tbody//tr//td//table//tbody//tr//td[contains(.,'General Application Statistics')]//following::td"));
    List properties = new ArrayList(3);
    List values = new ArrayList(3);
    for (int i=0;i all_items2 = driver.findElements(By.xpath("//table[@class='tabletext']/tbody//tr//td//table//tbody//tr//td[contains(.,'Legacy Configuration')]//following::td"));
    List properties = new ArrayList(1);
    List values = new ArrayList(1);
    for (int i=0;i

提交回复
热议问题