| || |
getDomains not returning the Net domain
I am trying to use the getDomains() method to return a Net domain application but the getDomains() call is not returning any Net domains. I also tried simply running Notepad to see if the Windows domain would return and it did not return either.
My code is as follows:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
DomainTestObject dto = getDomains();
for (int i = 0; i < dto.length; i++)
System.out.println("Domain: " + dto[i].getName());
}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Am I doing something wrong here? I am using Functional Tester 5.3.0.
Re: getDomains not returning the Net domain
I just wanted to post the answer I recieved from Rational regarding this issue in case anyone else had the same problem:
Windows and Net domains are essentially enabled dynamically (i.e., during recording or playback), as opposed to HTML and Java domains that are enabled beforehand. GetDomains only returns the enabled domains (plus the Process domain). So, you must do something in the script to enable the .Net domain before running GetDomains.
Here is an example based on the script you sent me.
Dim p1 As ProcessTestObject
p1 = StartApp("WindowsApplication2")
Dim pid As Long = p1.GetProcessId()
Dim rv As TestObject
Dim foundTOs() As TestObject
Dim root As RootTestObject = RootTestObject.GetRootTestObject()
Dim dom() As DomainTestObject
foundTOs = root.Find(AtDescendant(".processId", pid))
dom = root.GetDomains()
For i As Integer = 0 To dom.Length - 1
Debug.WriteLine("Domain:" & dom(i).GetName())
You enable the .Net domain on the root.Find command executed against your .Net application process.