#if or [Conditional(...)]

Hi team,

Would it be possible to include robot execution directives for different run modes (or DEBUG at least)?

It would ease transitions between stages as one would not need to worry (that much :wink: ) about leaving a stray Highlight, or worse yet MessageBox, somewhere, as well as having another alternative with test flows.

Similar effect could be achieved with Asset configuration (bool asset IsTestRun etc. and it in IF’s), but since there are no truly global variables, it would either need to be passed aroung as an argument, or you need GetAsset calls in numerous workflows (which impacts performance).

Another use case is showcase demo - with run mode directives you could use the exact same workflow to show how the robot works as well as actually running it (less changes → less opportunities for errors). Increasingly useful if you’re using WindowMessage or Simulate input flags.
Example:

Sequence:
	OpenBrowser(someAddress)
	#if DEMO
		Hover(selector)
		Highlight(selector)
	#endif
	Click(selector, Simulate)
	#if DEMO
		Highlight(someTableSelector)
	#endif
	DataScrape(someTableSelector)
	#if DEMO
		MessageBox(OutputDataTable(scrapeResult))
	#endif
	....

Opinions?

2 Likes

A post was merged into an existing topic: Flexible debugging idea - mark activity as a ‘debug’ activity with ability to globaly switch it off/on