X-Lite preferences to text devices

I use X-Lite for all my telephony. Unfortunately my headset sometimes disconnects from the computer without actually physically disconnecting. I want to write an Applescript that automatically uses the “test devices” function in X-Lite preferences to make sure the headset is connected when I open X-Lite. I have checked in X-Lite’s applescript dictionary and there are no specific functions for the preferences.

The script below gets as far as opening the preferences pane, but it does not do the last two steps of

  1. opening the “Devices” tab or window or whatever you call it
  2. clicking on the “Test Devices.” button

Would anyone know how to correct this ?

tell application "X-Lite" to activate

tell application "System Events"
	tell process "X-Lite"
		click menu item "Preferences." of menu "X-Lite" of menu bar 1
		delay 1
		tell window "Devices"
			click radio button "Test Devices."
		end tell
	end tell
end tell