我有一個黃瓜場景大綱,其中示例表我想傳遞一個空字符串(「」)和換行符(\ n \ n \ n)作爲價值。我想編輯一個文本字段,我正在刪除字符串,並希望傳入空字符串或換行符。我想發送這個值,然後按回車。這看起來像這樣.sendKeys(value +「\ n」)。在示例表中,將值留空並傳遞\ n \ n \ n不起作用。文本字段中的值不會更改。
這是該方案的輪廓看起來像:黃瓜場景大綱:在示例表中傳遞空字符串「」作爲值
Scenario Outline: Do not accept erroneous input as group conversation name (only spaces and break lines)
Given I Sign in using login <Login> and password <Password>
And I see Contact list with name <Name>
And I create group chat with <Contact1> and <Contact2>
When I open conversation with <Contact1>, <Contact2>
And I open Conversation info
And I set name <NewName> for conversation
Then I do not see conversation <NewName> in contact list
And I see Contact list with name <Contact1>, <Contact2>
Examples:
| Login | Password | Name | Contact1 | Contact2 | NewName |
| aqaUser | aqaPassword | aqaUser | aqaContact1 | aqaContact2 | |
| aqaUser | aqaPassword | aqaUser | aqaContact1 | aqaContact2 | \n\n\n\n |
如何傳遞的價值觀?
當我只是通過硬編碼值傳遞它的作品。文本字段至少被替換爲值,但我希望將其作爲佔位符。
硬編碼版本:
Scenario Outline: Do not accept erroneous input as group conversation name (only spaces)
Given I Sign in using login <Login> and password <Password>
And I see Contact list with name <Name>
And I create group chat with <Contact1> and <Contact2>
When I open conversation with <Contact1>, <Contact2>
And I open Conversation info
And I set name for conversation
Then I do not see conversation in contact list
And I see Contact list with name <Contact1>, <Contact2>
Examples:
| Login | Password | Name | Contact1 | Contact2 |
| aqaUser | aqaPassword | aqaUser | aqaContact1 | aqaContact2 |
Scenario Outline: Do not accept erroneous input as group conversation name (line breaks)
Given I Sign in using login <Login> and password <Password>
And I see Contact list with name <Name>
And I create group chat with <Contact1> and <Contact2>
When I open conversation with <Contact1>, <Contact2>
And I open Conversation info
And I set name \n\n\n\n\n for conversation
Then I do not see conversation \n\n\n\n\n in contact list
And I see Contact list with name <Contact1>, <Contact2>
Examples:
| Login | Password | Name | Contact1 | Contact2 |
| aqaUser | aqaPassword | aqaUser | aqaContact1 | aqaContact2 |
任何想法?謝謝
嗨@julesmummdry!你最終使用我的解決方案嗎?如果是這樣,也許你可以標記答案爲接受,如果它幫助 – troig 2017-04-05 10:39:15