TC: Array in KeywordTest
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2022
09:37 AM
12-02-2022
09:37 AM
TC: Array in KeywordTest
Hi,
how can I implement these VBScript lines in KeywordTest?
Sub INIT_ICO Project.Variables.ICO_XX = "09" For Each i In Array(Project.Variables.ICO_XX) ProjectSuite.Variables("APP_" & i) = "APP_" & i Next End Sub |
Labels:
- Labels:
-
Keyword Tests
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2022
10:40 AM
12-02-2022
10:40 AM
Does your script actually work?
What output are you expecting?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2022
02:04 PM
12-02-2022
02:04 PM
Hi rraghvani,
thanks for the tip, here is the correction:
Sub INIT_ICO 'Project.Variables.ICO_XX = "09" 'Project.Variables.APP_XX_NAME = "notepad" For Each i In Array(Project.Variables.ICO_XX) Project.Variables("APP_" & i) = Project.Variables.APP_XX_NAME Log.Message(Project.Variables("APP_" & i)) Next End Sub |
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2022
06:04 AM
12-03-2022
06:04 AM
You have your variables already defined in the project. In your keyword test use the For Loop statement with Code Expression for Array(Project.Variables.ICO_XX). Use Code Expression again for Project.Variables("APP_" & i) = Project.Variables.APP_XX_NAME, and then use Log to output the variable.
You can convert your keyword test to scripts, and see if it matches with what you have written.
