0

I'm looking to store a value from a popup box, split it into two and then use one of them to enter in a text box. The content I want is Document 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>

So far I have: StoreText | //div[@id='approval-dialog']/div/div[2]/div[2]/div[2]/ul/li[5] | DocumentID (Not sure how to split it) Type | id=TrackingID | ${DocumentID}

Note: Echoing displays the Document ID variable as : Document ID: 11330922E6258

I'd like the 11330922E6258 to be able to do a search in the Tracking ID box

1 Answers1

0

For split of sentence, use this code and let me know it work or not

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 
Ankit jain
  • 4,198
  • 4
  • 19
  • 24