I have to open an excel file using Katalon (able to export the file and open it using the robot class!), verify the text present in the column heading of the sheet and then close the excel file. Was going through the general discussions here, but kind of lost.
during your search saga on the forum topics, you didānt fond a pinned topic āhelp us to help youā? just curiousā¦
code samples please so we can have an idea what do you intend to achieve ⦠and how.
Hi @Ibus, I assumed that someone would guide me on how to write the code for verifying the excel text hence did not post the code (my bad). This is what I am doing (to open the excel sheet):
Robot robot = new Robot()
robot.keyPress(KeyEvent.VK_ENTER)
robot.keyRelease(KeyEvent.VK_ENTER)
WebUI.delay(5)
At this stage, the excel sheet opens up :
And this is where I get lost as I have to verify the column heading names present in the first row and then close the excel sheet afterwards:
This sounds stupid but I have to verify the heading names present in the Excel sheet. What kind of Desktop APIās should I use? Can you please shed some light on it?
Does āclose itā make sense? Youāre not opening Excel, youāre reading an Excel data file. I donāt do data driven testing (at least, not using external files) but Iām sure you just setup your connection to Excel, read a data file, test your data, end of story.
I think you should watch that video. It would save me having to watch it
At this stage, the *.xslx file is handled by the application of Microsoft Excel, not by Katalon Studio. Your test script in Katalon Studio knows nothing about the running Excel process and the downloaded *.xls file. Katalon Studio can do nothing to that.
You need to step back. You need to find out how to write a Katalon Studio test case which downloads the *.xlsx file from a web page into a local location on your PC so that your test case script can find the file locally. Opening the Excel file, verifying its row, closing it ā these questions should be addressed later.
You should show us how the HTML of your āDownload pageā looks like. Does it have <a href="url of *.xslx file">file</a>? In other words, can you find the URL of the target file readable from the DOM of the web page? Or, is the URL dynamically generated by JavaScript on click a button? All these details matter for writing downloader codes appropriately.