admin管理员组文章数量:1316351
I am trying to use Selenium Manager with NuGet packages to simulate real time functional scenarios like Online MS Sheets, and other workloads. I am able to login into the online excel at .
But I can see that my code might not be using the correct data_automation_id to create a new excel workbook. How do I know the data_automation_id's I would require for creating a workbook, writing some calculations in cells, and then saving it.
I want all of this to be as a real time UI simulation using Selenium
LogMessage("Attempting to create new workbook...", LogLevel.Info);
try
{
Thread.Sleep(5000); // Wait for page load
// Try multiple selectors for the new workbook button
try
{
WaitAndClick(driver, By.XPath("//div[contains(@title, 'New blank workbook')]"), TimeSpan.FromSeconds(20));
}
catch
{
try
{
WaitAndClick(driver, By.XPath("//button[contains(text(), 'New blank workbook')]"), TimeSpan.FromSeconds(20));
}
catch
{
WaitAndClick(driver, By.CssSelector("[data-automation-id='new-blank-workbook']"), TimeSpan.FromSeconds(20));
}
}
LogMessage("New workbook button clicked successfully", LogLevel.Info);
}
catch (Exception ex)
{
LogMessage("Failed to create new workbook", LogLevel.Error, ex);
throw;
}
本文标签: cHow to find the dataautomationid for creating new workbook in Microsoft sheets onlineStack Overflow
版权声明:本文标题:c# - How to find the data_automation_id for creating new workbook in Microsoft sheets online? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742000391a2410893.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论