I am planning to use MS office in Azure VM in pipeline approach. Below is my flow
Any possibility to apply license for MS office in VM image (created from Azure VM). Because, while creating VM the Appdata things (license, user data) are deleted.
Tried Appium to pick UI element and enter license key through pipeline:
Expecting: It should click the close and go to account settings for license registartion.
There are many libraries for reading and writing office. You do not need to have MS Office activated. Below is my simple test on VM without MS office:
using NPOI.HSSF.UserModel;
using NPOI.POIFS.Crypt.Dsig;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
DataTable dt = new DataTable();
HSSFWorkbook hssfworkbook;
using (FileStream file = new FileStream("../../../test.xls", FileMode.Open, FileAccess.Read))
{
hssfworkbook = new HSSFWorkbook(file);
}
HSSFSheet sheet = (HSSFSheet)hssfworkbook.GetSheetAt(0);
System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
HSSFRow headerRow = (HSSFRow)sheet.GetRow(0);
int cellCount = headerRow.LastCellNum;
for (int j = 0; j < cellCount; j++)
{
HSSFCell cell = (HSSFCell)headerRow.GetCell(j);
dt.Columns.Add(cell.ToString());
Console.WriteLine(cell.ToString());
}
for (int i = (sheet.FirstRowNum + 1); i <= sheet.LastRowNum; i++)
{
HSSFRow row = (HSSFRow)sheet.GetRow(i);
DataRow dataRow = dt.NewRow();
for (int j = row.FirstCellNum; j < cellCount; j++)
{
if (row.GetCell(j) != null)
dataRow[j] = row.GetCell(j).ToString();
}
dt.Rows.Add(dataRow);
}
....
I tried some steps and finally installed office like this https://learn.microsoft.com/en-us/deployoffice/office2019/deploy
And registered the key before creating VM image.
Now, product license not remove. I can able to see MS office is licensed (if I created VM again using that sample VM image definition).
Now, I am facing problem while launching office product (excel, word, outlook), "Accept and start excel", "Your privacy option" these windows are showing again and again.
Any idea to click close button using WinAppdriver through pipeline.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.