[![import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

//import javax.activation.DataHandler;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.sql.DataSource;
import javax.xml.xpath.XPath;

import org.openqa..By;
import org.openqa..;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import com.google.gdata.client.spreadsheet.SpreadsheetService;
import com.google.gdata.data.docs.SpreadsheetEntry;
import com.google.gdata.data.spreadsheet.ListEntry;
import com.google.gdata.data.spreadsheet.ListFeed;
import com.google.gdata.data.spreadsheet.WorksheetEntry;
import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;


public class Test1 {

     driver;
    String url="https://docs.google.com/spreadsheets/d/1dY4fdTre5Kz6rHzUAcyFoZvpHHBqKEQEI_HhcGG5KrY/edit#gid=0";

    @BeforeTest
    public void openbrowser() throws InterruptedException
    {

        System.setProperty(".chrome.driver", "E:\Selenium Jar\chromedriver_win32\chromedriver.exe");
        driver=new ChromeDriver();
        driver.get("https://www.google.com/gmail/about/#");
        WebElement gmaillink=driver.findElement(By.linkText("SIGN IN"));
        gmaillink.click();
    }



     @DataProvider(name = "Authentication2")

      public static Object[][] credentials2() {

            return new Object[][] { { "[email protected]", "[email protected]" }};

      }

    @Test(dataProvider="Authentication2")
    public void validdata(String id,String pas) throws InterruptedException, IOException, ServiceException
    {
        WebElement email=driver.findElement(By.id("identifierId"));
    //  email.clear();
        email.sendKeys(id);
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); 

        WebElement next=driver.findElement(By.id("identifierNext"));
        next.click();

        Thread.sleep(1000);

        WebElement password=driver.findElement(By.xpath("//*[@name='password']"));
        //password.clear();
        password.sendKeys(pas);

        Thread.sleep(2000);

        WebElement next1=driver.findElement(By.xpath("//*[@id='passwordNext']"));
        next1.click();


        SpreadsheetService service = new SpreadsheetService("Test Cases of lifeple");
         service.setUserCredentials(id, pas);

         URL metafeedUrl = new URL(url);

        /* SpreadsheetEntry spreadsheet = service.getEntry(metafeedUrl, SpreadsheetEntry.class);
            URL listFeedUrl = ((WorksheetEntry) spreadsheet.getWorksheets().get(0)).getListFeedUrl();
            ListFeed feed = (ListFeed) service.getFeed(listFeedUrl, ListFeed.class);
            for(ListEntry entry : feed.getEntries())
            {
              System.out.println("new row");
              for(String tag : entry.getCustomElements().getTags())
              {
                System.out.println("     "+tag + ": " + entry.getCustomElements().getValue(tag));
              }*/
    }
    }][1]][1]



Source link https://sqa.stackexchange.com/questions/35300/--for-the-java-lang-no-such--

LEAVE A REPLY

Please enter your comment!
Please enter your name here