Ask a Question

Passing of ImageRepository name or item from excel

SOLVED
Azeddin_Margani
Contributor

Passing of ImageRepository name or item from excel

 Hi all, 

Could someone please tell me how to pass ImageRepository name and or item from excel sheet. 

e.g.

ImageRepository.name.item

or

passing both name and item for use in JavaScript. 

 

Many Thanks.

AM.

 

 

 

A.M.
5 REPLIES 5
Marsha_R
Community Hero

Here's how you read data from an Excel file

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

 

The repository name won't be any different than any other piece of data.  You can either grab it directly from Excel in the script or you can read it into a variable from Excel and have your script access the variable.


Marsha_R
[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

Hi Marsha,

Please note i'm referring to the imageset.item of an image name that has already been saved in the image repository as (PaymentButton.Payment) where:
Imageset is: PaymentButton
Item is: Payment.

The piece of code to execute is.

Var Button =Imagerepository.imageset.item;
Button.Click;

I need to parametrize imageset and item so that it can be used on any image saved in the imagerepository. I tried to pass both imageset and item from excel but it doesn't seem to work.

Please provide me with an example on how this can be done.

Thanks.
AM.
A.M.
rraghvani
Super Contributor

Would the sections and examples in Image Repository, help you?

 

Example

rraghvani_0-1664445129406.png

 

 

Hi,

 

Try something like this:

var strItemFullName = 'Imagerepository.imageset.item';

var Button = eval(strItemFullName);
Button.Click;

 

Does this help?

 

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
================================

Hi AlexKaras, 

 

The use of eval() proven to be working before converting the passed parameter to a string. 

 

Many Thanks,

 

A.M.
cancel
Showing results for 
Search instead for 
Did you mean: