* Add a new test case
* Add a new Recording Module in this test case
* Click at "Record"
* Do an action of your choice, for example a simple mouse click
* Add an image base screenshot validation
* Stop the recording
* Convert both commands to user code
* Test it
Independent if the tests fails or not, the compiler returns no error and the test is running.
* Enter the user code
* Remove the lines which ends the first method and start the second method so that you have only one method with both actions in it
* Test it again
It will still run because Ranorex creates a new empty method for the second action.
* In the recording module, remove the second line (which only calls the empty method)
Now the compiler stops with the error
Code: Select all
The name '<Screenshot name'> does not exists in the current context (CS0103)
This also happens if you try to copy the Validate.ContainsImage() line to another test record, unlike all other methods I have used until now like Validate.Attribute() or others.
Is the screenshot bundled to the action line in the recording module ?
How can I create a copy a user code image validation to another method or module?