List<WebElement> 1=(List<WebElement>) chrome.findElements(By.xpath("//a[contains(@id,'GwtDateTimePicker_')]"));
    //[] selectday=new [1.size()];
    //System.out.println(selectday);
    //int i=0;
    /*for(WebElement a: 1)
    {

         String ="";
       selectday[i]=a.getText();
      if(selectday[i].contentEquals()){
           //Actions actions = new Actions(chrome);
        System.out.println(selectday[i]);///ideally yahan pe 18 click karwnaa hai but click honahi rah hai
        //break;
      }
      i++;
      break;
       }*/
    String ="18";
    for(int i=0;i<1.size();i++){
        //System.out.println("Content text is : " + 1.get(i).getText());
        // match the content here in the if loop
        if(1.get(i).getText().contentEquals()){
            // perform action
            //1.get(i).click();///alternate way bhi nahi hua---ideally yahan pe 18 click karwnaa hai but click honahi rah hai
            System.out.println(1.get(i).getText());
            //chrome.findElement(By.id("GwtDateTimePicker_ok")).click();
            break;
        }

        //System.out.println(1.get(i).getText());
        break;
    }



Source link https://sqa.stackexchange.com/questions/34811/my-below--is-not---trying-to---and---date-1

LEAVE A REPLY

Please enter your comment!
Please enter your name here