4

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

user2007843
  • 609
  • 1
  • 12
  • 30

1 Answers1

2

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”
user2007843
  • 609
  • 1
  • 12
  • 30
  • To your 3. point simply writing `$(CompPresence)` is sufficent. No need to write `'$(CompPresence)'=='true'` or even `'$(CompPresence)'.upper()=='TRUE'`. In any case I like `$(CompPresence)` more since it is shorter ;) Furthermore it is working independently of whether the variable contains 'True' (as in older QF-Test Versions) or 'true' as in newer QF-Test versions, see : `The implementation of the rc scripting API was unified for all scripting languages. ...` – quant Jan 21 '19 at 17:34