简体   繁体   English

如何使用STRING LIST的值运行记录的测试?

[英]How to run a recorded Test with Values of a STRING LIST?

I recorded a testcase Applikation, now I want to run the testcase, but istead of using: ------CustomerSearch.Customers.Select ("ARUNDEL, CLAUDE") -------- in my Code. 我记录了一个测试用例Applikation,现在我想运行该测试用例,但是不是在代码中使用------CustomerSearch.Customers.Select(“ ARUNDEL,CLAUDE”)--------。

I want to get the Customer (Person) from the LIST OF STRING. 我想从字符串列表中获取客户(人员)。

------CustomerSearch.Customers.Select ("" + Customer from List(Position 3)) -------- ------CustomerSearch.Customers.Select(“” +列表中的客户(位置3))--------

LIST OF STRING customers = {...} "ARUNDEL, CLAUDE" // 1 "BUCCIGRAS, CATHERINE" // 2 "COHEN, ROBIN" // 3 "CORELLI, ARCANGELO" // 4........ etc. STRING客户列表= {...}“ ARUNDEL,CLAUDE” // 1“ BUCCIGRAS,CATHERINE” // 2“ COHEN,ROBIN” // 3“ CORELLI,ARCANGELO” // 4 ........等等

Could somebody help me out? 有人可以帮我吗? How I iterate through list and pick everytime a different one 我如何遍历列表并每次选择不同的列表

How I write a function seperatly to use a person per every run? 如何分别编写一个函数以每次运行都使用一个人? so I can run the test with what ever name in the list over and over again? 这样我可以一次又一次地使用列表中的名字运行测试?

#use "FunktionGmo.t
#use "Test2.t"
# testcase Test1 ()
[ ] 
[ ] 
[ ] 
[-] recording
    [ ] GreenMountainOutpost.SetActive ()
    [ ] GreenMountainOutpost.Order.CustomerInformation.Pick ()
    [ ] CustomerInformation.SetActive ()
    [ ] CustomerInformation.DialogBox1.Search.Click ()
    [ ] CustomerSearch.SetActive ()
    [ ] // Kunde
    [ ] CustomerSearch.Customers.Select ("ARUNDEL, CLAUDE")
    [ ] CustomerSearch.Select.Click ()
    [ ] CustomerInformation.SetActive ()
    [ ] CustomerInformation.DialogBox1.PlaceOrder.Click ()
    [ ] PlaceOrder.SetActive ()
    [ ] PlaceOrder.DialogBox1.Search.Click ()
    [ ] ItemSearch.SetActive ()
    [ ] sleep(2)
    [ ] // Artikel
    [ ] ItemSearch.Items.Select ("3 PERSON DOME TENT")
    [ ] ItemSearch.Select.Click ()
    [ ] PlaceOrder.SetActive ()
    [ ] PlaceOrder.DialogBox1.Spin1.Increment ()
    [ ] PlaceOrder.DialogBox1.OrderItem.Click ()
    [ ] PlaceOrder.DialogBox1.CompleteOrder.Click ()
    [ ] CompleteOrder.SetActive ()
    [ ] CompleteOrder.DialogBox1.CardNumber.SetPosition (1, 1)
    [ ] // Kreditkartennummer
    [ ] CompleteOrder.DialogBox1.CardNumber.SetText ("111111-1111-11111")
    [ ] CompleteOrder.DialogBox1.ExpirationDate.SetPosition (1, 1)
    [ ] // Ablaufdatum der Kreditkarte
    [ ] CompleteOrder.DialogBox1.ExpirationDate.SetText ("02/20")
    [ ] CompleteOrder.DialogBox1.ProcessOrder.Click ()
    [ ] sleep(2)
    [ ] CompleteOrder.DialogBox1.Cancel.Click ()
    [ ] sleep(2)
    [ ] CustomerInformation.SetActive ()
    [ ] CustomerInformation.DialogBox1.Clear.Click ()
// Use "Filename" to work with the Data from the File.
use "Test2.inc"
use "FunktionGmo.t"
// Global Variable
string Name
string Artikel
string CardN
string Expi

testcase Test1 ()
// For each to loop through the list customers and take the same index from the other 3 lists.
int x = 1
for each Name in customers
    print(Name)
    Artikel = items[x]
    CardN = cardnumber[x]
    Expi = expirationdate[x]
    print(Artikel)
    print(CardN)
    print(Expi)
    print("----------------------")
    Bestellung (Name, Artikel, CardN, Expi)
    x++
_____________________________________________________________________________
Order:
use "Test2.inc"
use "Test3.t"
// Funktion für Bestelldaten
[+] // LIST OF STRING customers = {...} // List 1-14
[ ] // "ARUNDEL, CLAUDE"            // 1
[ ] // "BUCCIGRAS, CATHERINE"       // 2
[ ] // "COHEN, ROBIN"               // 3
[ ] // "CORELLI, ARCANGELO"     // 4
[ ] // "DURNFELD, PATRICIA"     // 5
[ ] // "GOLDSTEIN, MARTHA"          // 6
[ ] // "HARTMANN, JUDY"         // 7
[ ] // "JOHNSON, JAMES"         // 8 
[ ] // "JONES, RONALD"              // 9
[ ] // "LEYDON, THOMAS"         // 10
[ ] // "MURPHY, SONIA"              // 11
[ ] // "PERKINS, BOB"               // 12
[ ] // "ROBERTS, RANDY"         // 13
[ ] // "ROBERTSON, GUNNAR"          // 14

[+] // LIST OF STRING  items = {...}        // List 1-14
[ ] // "3 PERSON DOME TENT"         // 1
[ ] // "EXTERNAL FRAME BACKPACK"        // 2
[ ] // "GLACIER SUN GLASSES"            // 3
[ ] // "PADDED SOCKS"                   // 4
[ ] // "3 PERSON DOME TENT"         // 5
[ ] // "EXTERNAL FRAME BACKPACK"        // 6
[ ] // "GLACIER SUN GLASSES"            // 7
[ ] // "PADDED SOCKS"                   // 8
[ ] // "3 PERSON DOME TENT"         // 9
[ ] // "EXTERNAL FRAME BACKPACK"        // 10
[ ] // "GLACIER SUN GLASSES"            // 11
[ ] // "PADDED SOCKS"                   // 12
[ ] // "GLACIER SUN GLASSES"            // 13
[ ] // "PADDED SOCKS"                   // 14
[ ] // 
[ ] // 
[+] // LIST OF STRING  cardnumber = {...}       // List 1-14
[ ] // "111111-1111-11111"          //1
[ ] // "222222-2222-22222"          //2
[ ] // "333333-3333-33333"          //3
[ ] // "444444-4444-44444"          //4
[ ] // "555555-5555-55555"          //5
[ ] // "666666-6666-66666"          //6
[ ] // "777777-7777-77777"          //7
[ ] // "888888-8888-88888"          //8
[ ] // "999999-9999-99999"          //9
[ ] // "000000-0000-00001"          //10
[ ] // "000000-0000-00011"          //11
[ ] // "000000-0000-00111"          //12
[ ] // "000000-0000-01111"          //13
[ ] // "000000-0000-11111"          //14
[ ] // 
[+] // LIST OF STRING  expirationdate = {...}   // List 1-14
[ ] // "01/19"          //1
[ ] // "02/20"          //2
[ ] // "03/21"          //3
[ ] // "04/21"          //4
[ ] // "05/20"          //5
[ ] // "06/19"          //6
[ ] // "06/20"          //7
[ ] // "06/21"          //8
[ ] // "08/21"          //9
[ ] // "09/20"          //10
[ ] // "09/19"          //11
[ ] // "05/20"          //12
[ ] // "07/21"          //13
[ ] // "03/19"          //14

[-] Bestellung (string Name, string Artikel, string CardN, string Expi)
[-] // print("Das ist der verwendete Name: {Name},{Artikel},{CardN},{Expi}")
    [ ] 
    [ ] 
    [-] recording
        [ ] GreenMountainOutpost.SetActive ()
        [ ] GreenMountainOutpost.Order.CustomerInformation.Pick ()
        [ ] CustomerInformation.SetActive ()
        [ ] CustomerInformation.DialogBox1.Search.Click () //20
        [ ] CustomerSearch.SetActive ()
        [ ] CustomerSearch.Customers.Select (""+Name)
        [ ] CustomerSearch.Select.Click ()
        [ ] CustomerInformation.SetActive ()
        [ ] CustomerInformation.DialogBox1.PlaceOrder.Click ()
        [ ] PlaceOrder.SetActive ()
        [ ] PlaceOrder.DialogBox1.Search.Click ()
        [ ] ItemSearch.SetActive ()
        [ ] ItemSearch.Items.Select (""+Artikel)
        [ ] ItemSearch.Select.Click ()
        [ ] PlaceOrder.SetActive ()
        [ ] PlaceOrder.DialogBox1.Spin1.Increment ()
        [ ] PlaceOrder.DialogBox1.Spin1.Increment ()
        [ ] PlaceOrder.DialogBox1.OrderItem.Click ()
        [ ] PlaceOrder.DialogBox1.CompleteOrder.Click ()
        [ ] CompleteOrder.SetActive ()
        [ ] sleep(2)
        [ ] CompleteOrder.DialogBox1.CardNumber.SetPosition (1, 1)
        [ ] CompleteOrder.DialogBox1.CardNumber.SetText (""+CardN)
        [ ] CompleteOrder.DialogBox1.ExpirationDate.SetPosition (1, 1)
        [ ] CompleteOrder.DialogBox1.ExpirationDate.SetText (""+Expi) //40
        [ ] sleep(2)
        [ ] CompleteOrder.DialogBox1.ProcessOrder.Click ()
        [ ] sleep(5)
        [ ] CompleteOrder.DialogBox1.Cancel.Click ()
        [ ] CustomerInformation.SetActive ()
        [ ] CustomerInformation.DialogBox1.Clear.Click ()
        [ ] CustomerInformation.Close ()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM