0

我记录了一个测试用例应用程序,现在我想运行测试用例,但我的代码中没有使用: ------CustomerSearch.Customers.Select ("ARUNDEL, CLAUDE") --------。

我想从字符串列表中获取客户(人)。

------CustomerSearch.Customers.Select ("" + 列表中的客户(位置 3)) --------

字符串客户列表 = {...} "ARUNDEL, CLAUDE" // 1 "BUCCIGRAS, CATHERINE" // 2 "COHEN, ROBIN" // 3 "CORELLI, ARCANGELO" // 4........等等

有人可以帮帮我吗?我如何遍历列表并每次选择不同的列表

我如何单独编写一个函数来每次运行都使用一个人?所以我可以一遍又一遍地用列表中的名字运行测试?

#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 ()
4

1 回答 1

0
// 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 ()
于 2018-11-29T14:36:54.993 回答