mercredi 20 mars 2019

verify current temp is not greater or less then temps from daily timeline

I have an assignment and I could not do something. I want to get current temperature from daily time line dark sky website and current temp is not greater or less than temps from daily time line. I can get current temp and all temps from time line. I need to verify current temp is not greater or less than temps from daily timeline. Should be one of the temps. My code is following. My question how to verify it in selenium?

public void currentTempGreaterOrLess() {

    String currentTemp = SharedSD.getDriver(   ).findElement(By.xpath("//span[@class='first']")).getText( );
    System.out.println(currentTemp);
    WebElement currentTemprature = SharedSD.getDriver().findElement(By.xpath("//span[@class='first']"));
    if(currentTemp.equals(currentTemprature)){
        Assert.assertTrue(true);
    }
    List<WebElement> allTemps = SharedSD.getDriver( ).findElements(By.xpath("//div[@id='timeline']//div[@class='temps']"));

}

Aucun commentaire:

Enregistrer un commentaire