代码优化2

    xiaoxiao2021-03-25  134

    for (inti=0; i<lable.size(); i++){

               if(lable.get(i).getText().contains(dQPlayerNumber)){

                  if(i==0){

                      WebElement player = driver.findElement(By.cssSelector("tbody[id$='tbodyPlayerListForPlayerRoster']tr:first-child td:nth-child(3) font"));

                      Assert.assertTrue(player.getText().contains(message));

                      log.info("Playerinfo: " + player.getText());

                      Assert.assertEquals(player.getAttribute("color"), "red");

                      log.info("Assert DQplayer on Stats and Standing");

                  }else{

                      WebElement player = driver.findElement(By.cssSelector("tbody[id$='tbodyPlayerListForPlayerRoster']tr:nth-child("+ (i+1) +") td:nth-child(3) font"));

                      Assert.assertTrue(player.getText().contains(message));

                      log.info("Playerinfo: " + player.getText());

                      Assert.assertEquals(player.getAttribute("color"), "red");

                      log.info("Assert DQplayer on Stats and Standing");

                  }

               }

           }  

    转载请注明原文地址: https://ju.6miu.com/read-11422.html

    最新回复(0)