简体   繁体   中英

ReadyAPI - Automation script to get the value from data source step

i am new to ReadyAPI and automation. But now i facing some issue where i wanted to fill in the consent page will the value that will get from the Data source. The Role value is the value that i need to get and fill into the consent page

Here is my automation code to get the value: I have to get the value from Data source, then fill into text box, then click button

This is the code im using:

document.getElementById('freeTextHabilitations').value = 'ObjectiveCombinaisons Data Source#Role';

document.getElementById('allowBtn').click();

I having problem where get nothing after the data source ran . Anyone have any idea on how to inject the value from data source to automation script (java?) Thank you.

Stanley, Unclear as to how you are using DOM methods(with ReadyAPI), but to answer your question on accessing Data Source values

For that, you will need property expansion. So, your groovy script should be something like

xxxx.value = context.expand( '${ObjectiveCombinations Data Source#Role}' )

Property Expansion

This can be generated for you by using the Get Data dialog

Get Data Dialog

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM