cancel
Showing results for 
Search instead for 
Did you mean: 

Copy and paste data from Excel to application under test (javascript)

SOLVED
TrevorM
New Contributor

Copy and paste data from Excel to application under test (javascript)

My application under test is a  desktop app for finance

I need to copy a range of data from an xlsx file to the clipboard and then paste this into my app, i.e. I do not need to read the data into TestComplete e.g. in sheet2 of test.xlsx select and copy a2:j30

 

I can do this by opening Excel, selecting the data and then copying this into my app

This is fine my dev setup, but in my Test environment the servers do not have Excel installed

 

All the Excel examples I have seen seem to be for individual cells rather than a range of cells.

The link below suggest using COM, but the sample is only for reading the data.

https://support.smartbear.com/testcomplete/docs/testing-with/working-with-external-data-sources/exce...

 

Is what I am trying to do possible, and if so can anyone give some pointers?

1 ACCEPTED SOLUTION

Accepted Solutions
hkim5
Staff

Re: Copy and paste data from Excel to application under test (javascript)

you would need to scrip that portion, and create a helper function to "copy" the values from the selected cell ranges.

something like a for loop restricted by the length set by the user dictating the rows to iterate over, appending each cell value to a list or dictionary? I think would be the simplest way to reuse the values again later in another application as your end use would. 

Best,
Justin Kim

View solution in original post

5 REPLIES 5
Marsha_R
Community Hero

Re: Copy and paste data from Excel to application under test (javascript)

Are you testing copy/paste function in your app or are you just trying to get the data into your app some way?  I ask because sometimes the easy way for a user to perform the task and the easy way for TestComplete to perform the task are two different things.  What is your actual goal here?

BenoitB
Community Hero

Re: Copy and paste data from Excel to application under test (javascript)

No Excel license on your test environment will be a problem ..

 

You cannot have data in csv instead of xls(x) ?

 

If you can, csv are text file so very easy to manipulate without no needs of license, components and so on ..

 

Un sourire et ça repart

AlexKaras
Community Hero

Re: Copy and paste data from Excel to application under test (javascript)

Hi,

 

the servers do not have Excel installed

Consider Excel object provided by TestComplete which does not require Excel application to be present on the box.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
TrevorM
New Contributor

Re: Copy and paste data from Excel to application under test (javascript)

I am trying to replicate how our customers use our app. Typically they will receive data in an Excel spreadsheet and can either import this directly or can copy and paste some of the data.

I have looked at Excel Object, but as I said in my original post I don't see how to copy a range of cells rather than an individual one.

hkim5
Staff

Re: Copy and paste data from Excel to application under test (javascript)

you would need to scrip that portion, and create a helper function to "copy" the values from the selected cell ranges.

something like a for loop restricted by the length set by the user dictating the rows to iterate over, appending each cell value to a list or dictionary? I think would be the simplest way to reuse the values again later in another application as your end use would. 

Best,
Justin Kim

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors