Search code examples
qf-test

If statement in QF-test


I am learning QF-test and want to do a simple if statement. If I make a change on this one page it enabled an "Apply" button that I want to click if it becomes enabled.

When I check if the button is enabled this is what appears

Check boolean: enabled (true) [buttonApply=>($client)]

So I want to say something like

if 'buttonApply.enabled'=="true"
Mouse Click [buttonApply=>($client)]

but that doesn't seem to work


Solution

  • Well I emailed QF-test support and got this answer

    1. Set the variable in the field 'Variable for Result'. Let's say 'CompPresence'
    2. When you run the script , the variable 'CompPresence' will be filled with the value 'true' if the button "Apply" is enabled.
    3. You can use the If loop like If '$(CompPresence)'==”true”