cancel
Showing results for 
Search instead for 
Did you mean: 

Checkpoint image rename

SOLVED
mikileung
Occasional Contributor

Checkpoint image rename

Hi, 

 

I am working on a data loop test, and want to capture all the images with a specific name using variables. How can I do it? 

 

- user and password (data loop variables)

- login to the system

- capture the home page 

- log out

 

So i want the picture to be the username, how can I do that? 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
sonya_m
Community Manager

Re: Checkpoint image rename

Thanks everyone for participating!

 

@mikileung Please let us know if you managed to solve this using advice from the replies or in any other way.

 

If you didn't, I'd suggest raising a support ticket. Thank you! 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

9 REPLIES 9
Marsha_R
Community Hero

Re: Checkpoint image rename

So if you have logged on as MickeyMouse then you are looking for images on the page that are labeled as MickeyMouse?

 

It will be something like this except you are looking for the label instead of the image name.

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/examples/finding-an-image.ht...

 

Use the variable with the login name to build a string that is the label name and then search for that.

 

Try it and let us know what you get and we can help in more detail.

mikileung
Occasional Contributor

Re: Checkpoint image rename

Hi, 

 

I am not looking for searching an image. once the user logs into the system, I would like to capture that home page. Since I am testing over 50 users, I would like to rename all the images with the username which are variables from an excel. 

 

Thanks. 

 

AlexKaras
Community Hero

Re: Checkpoint image rename

Hi,

 

Can you provide more details/code/screenshots/examples as I barely understand what you are looking for?

 

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
================================
mikileung
Occasional Contributor

Re: Checkpoint image rename

Hi Alex, 

 

My test is a keyword test (below image). It is to test if all the required users have been created in the system. 

I have an excel sheet listed all the user IDs and passwords for data loop variables. I managed to do that and everything works. 

 

On top of that, I want to take screenshot of the home page for each of these users, because I found out that some of them have empty box with unloaded applications (see below images). I used checkpoint to do that but in my log file, the naming makes it very hard to find which is which user's home page. I would like to ask if there is a way to rename those images with username variables. 

 

thank you 

 

Below is my keyword test. 

mikileung_0-1610376950938.png

 

mikileung_1-1610377534943.png

 

 

Marsha_R
Community Hero

Re: Checkpoint image rename

You can save the image and then rename it to whatever is useful for you.

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/renamefile.ht...

AlexKaras
Community Hero

Re: Checkpoint image rename

Hi,

 

Still not sure as for what exactly you want to get.., but why not to add the Append Log Folder operation right after the loop start and name the folder according to current test user name and add the Pop Log Folder operation at the end of the data loop.

Does this help somehow?

 

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
================================
sonya_m
Community Manager

Re: Checkpoint image rename

Thanks everyone for participating!

 

@mikileung Please let us know if you managed to solve this using advice from the replies or in any other way.

 

If you didn't, I'd suggest raising a support ticket. Thank you! 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

mikileung
Occasional Contributor

Re: Checkpoint image rename

 I can rename the log folders, but not the jpg itself. I need to see if it works in term of approver's perspective. 

AlexKaras
Community Hero

Re: Checkpoint image rename

Hi,

 

Are you looking for something like that:

      strPageItemName = aqString.Format('%s_%s_%ix%i_%s%i_%s',
          strFolder, Sys.OSInfo.Name, oSize.w, iHeight /*oSize.h*/,
          oBrowser.ProcessName,
          aqObject.IsSupported(oBrowser, 'FileVersionInfo') ? oBrowser.FileVersionInfo.MajorPart : '',
          strPageName);

      if (Regions.Contains(strPageItemName))
      {
        if (! Regions.Compare(strPageItemName, pagePicture))
          Log.Error("The compared regions are not identical.", strPageItemName);
      }
      else
      {
        strFilePath = Project.Path + 'Stores\\Regions\\' + strFolder + '\\'; // + strPageItemName + '.png';
        if (Regions.AddPicture(pagePicture, strPageItemName, false, strFilePath))
          Log.Warning('Image of new ' + strPageItemName + ' page was added to Stores Regions',
              strFilePath);
        else
          Log.Error('Error adding ' + strPageItemName + ' page image to Stores Regions',
              Regions.LastError);
      }

 

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
================================
New Here?
Join us and watch the welcome video:
Announcements