簡體   English   中英

如何使用STRING LIST的值運行記錄的測試?

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

我記錄了一個測試用例Applikation,現在我想運行該測試用例,但是不是在代碼中使用------CustomerSearch.Customers.Select(“ ARUNDEL,CLAUDE”)--------。

我想從字符串列表中獲取客戶(人員)。

------CustomerSearch.Customers.Select(“” +列表中的客戶(位置3))--------

STRING客戶列表= {...}“ 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 ()
// 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