Forum Discussion

rmnrdi's avatar
rmnrdi
Contributor
8 years ago

registry key not found [Solved]

I'm trying to access a registry key but I keep getting run time errors saying the key doesn't exist.

 

I'm running TC in administrator mode and I'm copying and pasting the path directly from the registry.

 

Also, I brought in the code from the TC site here:

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/multiple-os/typical-tasks/registry-layouts.html 

 

and it works fine...unless I put my registry path in it. Then I get a run time error.

 

Here's the full path as copy/pasted from the registry:

'Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Ocuco\Innovations'

 

Here's the code:

// Gets an object for the system registry key
KeyName := 'Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Ocuco\Innovations';
Key := Storages.Registry(KeyName, HKEY_LOCAL_MACHINE,1,true);

 

I've tried 64 bit mode to 0 and 1. I've tried setting read-only to true or false. I've also tried shortening the string by one level so it became: 'Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Ocuco'

 

I've attached a picture of the error.

 

Any thoughts or suggestions would be appreciated.

 

Here's the problem:

When TC tells you to put the full path in for the registry entry, they only mean from HKEY... over.

This string worked: 'SOFTWARE\WOW6432Node\Ocuco'

 

Which isn't the full path at all.

 

 

 

1 Reply

  • Hi rmnrdi,

     

    I see that you have marked this topic as solved (in the subject). Do you mind sharing your solution with us?

    It may help other community members in the future. Thanks!