Failed to take screenshot reframework

I tried to add the take screenshot code in reframework and I put one inside initialization cause I need to capture screenshot if there is error in initialization. Why am receiving this error ?

Failed to take screenshot: Object reference not set to an instance of an object. at Source: Anonymously Hosted DynamicMethods Assembly. Thanks for idea

is your exception occurring before or inside the InitAllSettings.xaml?
If your Config dictionary is null, this would be expected.

@nameless how do I know if config dic is null ?

check for the config dictionary is null or not

If i put the take screenshot feature on intinialization where does config dictionary come from ?

the value for config dictionary from the “InitAllSettings workflow”

so if the take screenshot workflow before the “InitAllSettings workflow” the value of the config dictionary is null.

can you provide an example @motazalzaatreh1995 , would really appreciate it .

before the TakeScreenshot workflow print the value of the in_Folder

to check the value is null or not

so you can check it at the config file at Constants Sheet if the value of ExScreenshotsFolderPath is null or not

The value is empty upon checking @motazalzaatreh1995

check it at the config file at Constants Sheet if the value of ExScreenshotsFolderPath is null or not

@motazalzaatreh1995

@AhmedKutraphali I took another look at your first screenshot. If you are using the screenshot workflow in Main.xaml, you variable should be Config instead of in_Config. The latter is an argument used inside other workflows and not initialized in Main. Therefore, in_Config is null/nothing.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.