0

我希望从弹出框中存储一个值,将其分成两部分,然后使用其中一个输入文本框中。我想要的内容是文档 ID。

<div id="approval-dialog" class="modal hide fade in" style="display: block;" aria-hidden="false">
<div>
<div class="modal-header">
<div class="modal-body">
<div id="DialogError" class="hide"> </div>
<form id="ApprovalForm" class="form-horizontal" method="post" action="/Practice/Approve">
<div class="approved">
<div class="well well-small"> The following approval certificate has been applied to - EMED.pdf </div>
<div class="well well-small certificate">
<ul>
<li>Name: Client 001</li>
<li>
TimeStamp: 18/03/2013 11:49  
<span>(UTC)</span>
</li>
<li>Document ID: 11330922E6258</li>
</ul>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>

到目前为止,我有: StoreText | //div[@id='approval-dialog']/div/div[2]/div[2]/div[2]/ul/li[5] | DocumentID (不知道如何拆分) 类型 | id=跟踪ID | ${文档ID}

注意:回显将文档 ID 变量显示为:文档 ID:11330922E6258

我希望 11330922E6258 能够在 Tracking ID 框中进行搜索

4

1 回答 1

0

对于句子的拆分,请使用此代码并让我知道它是否有效

store   | Document ID: 11330922E6258 | string
store   | 1 | delimiter
store   | javascript{storedVars['string'].split('ID:')[storedVars['delimiter']]} | name
echo    | ${name}


[info] Executing: |store | Document ID: 11330922E6258 | string |
[info] Executing: |store | 1 | string1 |
[info] Executing: |store | javascript{storedVars['string'].split('ID: ')[storedVars['string1']]} | name |
[info] Executing: |echo | ${name} | |
[info] echo: 11330922E6258 
于 2013-03-21T11:37:06.343 回答