Forum Discussion

morciani's avatar
morciani
Occasional Contributor
16 years ago

Referencing properties inside a DataGen Test Step

Hello,

Is there a way to reference properties from within a DataGen Test step?  I want to be able to conditionally set the value of a second property based on the value of the first property. Both properties are contained in the same DataGen step (DataGen_getGlobalData) Take this example of this Test Step:

Test Step Name: DataGen_getGlobalData

Property1: SignOnRoleCd (Type = Script, Mode = STEP, not Shared)

Configuration:
import javax.swing.*
String SignOnRoleCd=JOptionPane.showInputDialog("SignOnRoleCd: Agent or Customer");

Property2: PIN ((Type = Script, Mode = STEP, not Shared)

Configuration:
if (#SignOnRoleCd == "Customer")
{
String PIN = "N0000000"
} else {
String PIN=JOptionPane.showInputDialog("PIN");
}

How do I reference SignOnRoleCd within the configuration of Property2?

2 Replies

  • Mason's avatar
    Mason
    Frequent Contributor
    I'm wanting to know the answer to this as well.  Any input from the community?
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    if (context.expand('${SignOnRoleCd}') == "Customer")


    (Don't forget to import javax.swing in the second property!)