dimanche 31 mai 2015

How to read a text from a page using Helium?

enter image description here

I want to read the text showing in the picture and want to print that text using helium. I tried the following code

import org.openqa.selenium.WebDriver;

//import com.heliumhq.selenium_wrappers.WebDriverWrapper;

import static com.heliumhq.API.*;


public class mainClass {

    public static void main(String[] args) {
        WebDriver ff = startFirefox("http://ift.tt/1JiIdet");
        waitUntil(Text("Streams Tech, Inc.").exists);

        streamstech lg = new streamstech();
        lg.login(ff);
         if (getDriver().getValue().contains("You have not purchased any product yet. Please visit our product list to try out different products!"))
                System.out.println("You have not purchased any product yet. Please visit our product list to try out different products!");
            else
                System.out.println("Test failed :(");
        //String text = getValue("You have not purchased any product yet. Please visit our product list to try out different products!");
        killBrowser();



    }

}

But for getValue() I am getting an error "The method getValue() is undefined for the type WebDriver" Appreciate your help. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire