NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package Demo;

import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;

import io.github.bonigarcia.wdm.WebDriverManager;

public class FontTest {

public static void main(String[] args) throws IOException, InterruptedException {
// TODO Auto-generated method stub

//System.out.println("Hello World");
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();

driver.get("https://fonts.adobe.com/foundries");
driver.findElement(By.xpath("//button[@id='onetrust-reject-all-handler']")).click();
List<WebElement> element = driver.findElements(By.xpath("//p[@class='spectrum-Body--large foundry-landing-page-item--foundry-name ng-binding']"));
//System.out.println(tagname);
FileInputStream instreamSet= new FileInputStream(".\FontsData.xlsx");
XSSFWorkbook workbook = new XSSFWorkbook(instreamSet);
XSSFSheet sheet = workbook.getSheetAt(0);

System.out.println(element.size());
for(int i=0; i<1;i++) {
String foundryName= "";
foundryName= element.get(i).getText();
System.out.println(foundryName);
Thread.sleep(3000);
Actions actions = new Actions(driver);
actions.moveToElement(element.get(i)).click().build().perform();
//element.get(i).click();
Thread.sleep(3000);

WebElement element1= driver.findElement(By.xpath("//span[@class='adobe-fonts-family-card__family_name ng-binding']"));
String foundrySubName="";
foundrySubName= element1.getText();
//element1.click();
System.out.println(foundrySubName);
actions.moveToElement(element1).click().build().perform();

List<WebElement> element2= driver.findElements(By.xpath("//ul[@class='spectrum-grid-row spectrum-grid-start-xs list--no-decoration font-variation-list']/li/div/div/div/span"));
System.out.println("Element2 size"+ element2.size());
for(int l=0;l<element2.size();l++) {
String foundrySubItem="";
foundrySubItem= element2.get(l).getText();
System.out.println(foundrySubItem);
XSSFRow row= sheet.createRow(l+1);

XSSFCell cell= row.createCell(0);
cell.setCellValue((String) foundryName);

XSSFCell cell1= row.createCell(1);
cell1.setCellValue((String) foundrySubName);

XSSFCell cell2= row.createCell(2);
cell2.setCellValue((String) foundrySubItem);
}


}
instreamSet.close();
String filepath= ".\FontsData.xlsx";
FileOutputStream outstream= new FileOutputStream(filepath);
workbook.write(outstream);
outstream.close();
workbook.close();
System.out.println("=============Excel created=================");

driver.close();
}

}







<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>

<!-- Apache POI-OOXML Dependency -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>

<!-- Apache POI-OOXML SCHEMAS Dependency -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>

<!-- Apache OOXML SCHEMAS Dependency -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.4</version>
</dependency>

<!-- Apache XML Beans Dependency -->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>3.1.0</version>
</dependency>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.