TimeoutException on ActiveBrowser.LaunchNewBrowser()

14 posts, 0 answers
  1. akesy
    akesy avatar
    3 posts
    Member since:
    Feb 2012

    Posted 16 Mar 2012 Link to this post

    Hello,

    For a couple of days I have been trying to solve an issue and I stucked. I am trying to run automated UI tests using Telerik WebAii Framework 2011.2.1413. The problem is, after launching browser nothing happens but I get TimeoutException: Wait for condition has timed out. The issue occurs only on Internet Explorer, tests on FireFox 3.6 run properly, though. I suppose it is not IE problem but some operating system security settings as I run tests on Windows Server  2008 R2 (x64). Tests run properly on IE9 on Windows 7 Ultimate (x64). I would like to also mention that tests run on Team Foundation Server 2010 build machine. Below, I have enclosed my system environment and thigns I have already done to try to make it work.

    System Environment:
    Windows Server 2008 R2 (x64) SP1
    IE 8 (previously, I have tried to run test on IE9 but it did not work as well, that is why i downgraded IE to see wheater it is browser version problem)
    MSTest
    Telerik WebAii Framework 2011.2.1413
     
    - I set target platform in project properties to x86
    - I set Team Foundation Server 2010 Mode to Interactive Process
    - I configured Internet Explorer as it is written <a href="http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/configure-your-browser/internet-explorer.aspx">here</a>.
    - I turned off Internet Explorer Enhanced Security Configuration
    - I turned off User Account Control
    - I reinstalled Telerik WebAii Framework
    - I set "Restrict anonymous access to named pipes and shares" to Disabled on Local Security Policy

    TraceLog file from failed session:

    DialogPlayback: DialogMonitor.Start() : Beginning monitoring for dialogs from the set {}.

    Framework: InternetExplorerActions.LaunchNewBrowserInstance() : Process launched (ID=2612, Path="C:\Program Files (x86)\Internet Explorer\iexplore.exe", Arguments="-nomerge about:blank").

    UIAutomation: AutomationExtensions.AddAutomationEventHandler() : Added a(n) WindowPatternIdentifiers.WindowOpenedProperty handler on element System.Windows.Automation.AutomationElement scope Descendants.

    Framework: InternetExplorerActions.LaunchNewBrowserInstance() : Attempting to attach on IE frame (HWND=66614)...

    DialogPlayback: DialogMonitor.AutomationEvent_OnWindowOpened() : New window detected, but not considered a dialog (Text = "Windows Internet Explorer", ClassName = "IEFrame").

    Framework: Connector.Start() : Process launched (ID=3100, Path="C:\Windows\SysWOW64\rundll32.exe", Arguments="ArtOfTest.Connector.dll,AttachToWindowEntryPoint 132206").

    Framework: Connector.Start() : Process exited (ID=3100, ExitCode=0, Path="C:\Windows\SysWOW64\rundll32.exe", Arguments="ArtOfTest.Connector.dll,AttachToWindowEntryPoint 132206").

    Framework: InternetExplorerActions.LaunchNewBrowserInstance() : Process "QTAgent32" (ID=1936) is assumed to host the controller.

    Framework: Connector.InjectCode() : ------- Function Start -------

    Framework: Connector.InjectCode() : Connection string: C:\Windows\assembly\GAC_MSIL\ArtOfTest.InternetExplorer\2011.2.1413.0__5339893a7cefe4d6\ArtOfTest.InternetExplorer.dll?ArtOfTest.InternetExplorer.ArtOfTestPluginEntryPoint?1936

    Framework: InternetExplorerActions.WaitForDocument() : Attempting to get IHTMLDocument2 from Internet Explorer HWND 132206 on another thread...

    Framework: <>c__DisplayClasse.<WaitForDocument>b__7() : Attempting to get document from window handle

    Framework: InternetExplorerActions.WaitForDocument() : IHTMLDocument2 successfully retrieved.

    Framework: Connector.InjectCode() : Sending WM_COPYDATA to HWND 132206 (lpData = "C:\Windows\assembly\GAC_MSIL\ArtOfTest.InternetExplorer\2011.2.1413.0__5339893a7cefe4d6\ArtOfTest.InternetExplorer.dll?ArtOfTest.InternetExplorer.ArtOfTestPluginEntryPoint?1936")...

    Framework: Connector.InjectCode() : Returned from sending WM_COPYDATA (LRESULT=0, GetLastError()=ERROR_ALREADY_EXISTS).

    Framework: Connector.InjectCode() : ------- Function End -------

    Framework: BrowserProvisioner.EndService() : Connecting to the provisioning pipe "Pipe.ArtOfTest.WebAii.BrowserProvisioner_696317534" in order to unblock and eventually terminate it...

    Framework: BrowserProvisioner.EndService() : Provisioning pipe connected.

    Framework: BrowserProvisioner.ServiceThread() : A new client has connected to the provisioning pipe but this will be treated as a termination cue.

    Framework: BrowserProvisioner.EndService() : Provisioning thread terminated.

    DialogPlayback: DialogMonitor.Stop() : Dialog monitoring is being halted.

    TraceLog from passed session (FireFox 3.6):

    [03/16 10:38:43,QTAgent32.exe(2628:13)] First trace message from process 2628: "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe" /agentKey 2313be3d-37b0-43f1-8128-8c75e6338426 /hostProcessId 1928 /hostIpcPortName eqt-b14fb823-1ed9-ccf3-2bea-2e672dc75686
    [03/16 10:38:43,QTAgent32.exe(2628:13)] First trace message from background thread "Agent: adapter run thread for test 'SampleWebAiiTest' with id '8fcc0856-0ea4-4f74-b955-3c367338568c'" (managed ID = 13, native ID = 2732).
    [03/16 10:38:43,QTAgent32.exe(2628:13),DialogPlayback] DialogMonitor.Start() : Beginning monitoring for dialogs from the set {}.
    [03/16 10:38:44,QTAgent32.exe(2628:13),Framework] FireFoxActions.EnumFireFoxInstallations() : Valid Firefox 3.6.0.20 installation found at "C:\Program Files (x86)\Mozilla Firefox\firefox.exe".
    [03/16 10:38:45,firefox.exe(1936:1)] First trace message from process 1936: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" about:blank?753956868
    [03/16 10:38:45,firefox.exe(1936:1)] First trace message from background unnamed thread (managed ID = 1, native ID = 2740).
    [03/16 10:38:45,firefox.exe(1936:1),Framework] BrowserRemoteClient constructor : The client ID for this hooked process will be "Client_2c97f56d-585a-4358-9975-233d960ddd64".
    [03/16 10:38:45,QTAgent32.exe(2628:17)] First trace message from background thread "Pipe.ArtOfTest.WebAii.BrowserProvisioner" (managed ID = 17, native ID = 2720).
    [03/16 10:38:45,QTAgent32.exe(2628:17),Framework] BrowserProvisioner.ServiceThread() : A new client has connected to the provisioning pipe.
    [03/16 10:38:45,QTAgent32.exe(2628:19)] First trace message from background thread "Remoted async command listener" (managed ID = 19, native ID = 2300).
    [03/16 10:38:45,QTAgent32.exe(2628:19),Framework] BrowserRemoted.AsyncListenerThreadEntry() : Not connected; this will now wait indefinitely for a pipe client connection...
    [03/16 10:38:45,firefox.exe(1936:1),Framework] BrowserRemoteClient.CreateNamedPipes() : Named pipes created for communication with the server: {Command = "ae3c20d9-1d96-4639-abc2-3e0cb0a5352a.CommandPipe", Async = "ae3c20d9-1d96-4639-abc2-3e0cb0a5352a.AsyncPipe"}
    [03/16 10:38:45,QTAgent32.exe(2628:18)] First trace message from foreground unnamed thread (managed ID = 18, native ID = 2648).
    [03/16 10:38:45,QTAgent32.exe(2628:18),UIAutomation] AutomationExtensions.AddAutomationEventHandler() : Added a(n) WindowPatternIdentifiers.WindowOpenedProperty handler on element System.Windows.Automation.AutomationElement scope Descendants.
    [03/16 10:38:46,QTAgent32.exe(2628:19),Framework] BrowserRemoted.AsyncListenerThreadEntry() : A new client has connected to the pipe.
    [03/16 10:38:46,QTAgent32.exe(2628:19),Framework] BrowserRemoted.AsyncListenerThreadEntry() : Now waiting indefinitely for a command from the pipe client...
    [03/16 10:38:46,QTAgent32.exe(2628:17),Framework] Manager.AddNewBrowser() : Added client ID "Client_2c97f56d-585a-4358-9975-233d960ddd64" (now there is/are 1 total).
    [03/16 10:38:47,QTAgent32.exe(2628:18),UIAutomation] AutomationExtensions.AddAutomationPropertyChangedEventHandler() : Added property change handler on element System.Windows.Automation.AutomationElement scope Subtree with enlarged property set {ValuePatternIdentifiers.ValueProperty} now including {ValuePatternIdentifiers.ValueProperty}.
    [03/16 10:38:47,QTAgent32.exe(2628:18),UIAutomation] AutomationExtensions.AddStructureChangedEventHandler() : Added a structure change handler on element System.Windows.Automation.AutomationElement scope Subtree.
    [03/16 10:38:48,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "Search".
    [03/16 10:38:49,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "http://fp-shp/Pages/default.aspx".
    [03/16 10:38:49,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnValueChanged() : Named element "Szukaj w zakładkach i historii" changed its value from "" to "http://fp-shp/Pages/default.aspx".
    [03/16 10:38:49,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "Turn on more accessible mode".
    [03/16 10:38:50,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "My Newsfeed".
    [03/16 10:38:51,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "http://fp-shp/my/default.aspx".
    [03/16 10:38:51,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnValueChanged() : Named element "Szukaj w zakładkach i historii" changed its value from "" to "http://fp-shp/my/default.aspx".
    [03/16 10:38:51,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "Adres".
    [03/16 10:38:52,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "Adam Kęsy".
    [03/16 10:38:52,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnStructureChanged() : ChildAdded event sent by named element "http://fp-shp/my/personal/akesy/default.aspx".
    [03/16 10:38:53,QTAgent32.exe(2628:18),DialogPlayback] DialogMonitor.AutomationEvent_OnValueChanged() : Named element "Szukaj w zakładkach i historii" changed its value from "" to "http://fp-shp/my/personal/akesy/default.aspx".
    [03/16 10:38:53,QTAgent32.exe(2628:13),Framework] BrowserProvisioner.EndService() : Connecting to the provisioning pipe "Pipe.ArtOfTest.WebAii.BrowserProvisioner" in order to unblock and eventually terminate it...
    [03/16 10:38:53,QTAgent32.exe(2628:13),Framework] BrowserProvisioner.EndService() : Provisioning pipe connected.
    [03/16 10:38:53,QTAgent32.exe(2628:17),Framework] BrowserProvisioner.ServiceThread() : A new client has connected to the provisioning pipe but this will be treated as a termination cue.
    [03/16 10:38:53,QTAgent32.exe(2628:13),Framework] BrowserProvisioner.EndService() : Provisioning thread terminated.
    [03/16 10:38:53,QTAgent32.exe(2628:13),DialogPlayback] DialogMonitor.AddDialog() : Added {OnBeforeUnloadDialog(Dismiss=OK)} for monitoring.
    [03/16 10:38:53,QTAgent32.exe(2628:13),Framework] Manager.RemoveBrowser() : Removed client ID "Client_2c97f56d-585a-4358-9975-233d960ddd64" (0 remaining).
    [03/16 10:38:53,QTAgent32.exe(2628:13),Framework] Manager.SetActiveBrowser() : Active browser is now null.
    [03/16 10:38:53,QTAgent32.exe(2628:13),Framework] BrowserRemoted.End() : Now aborting the listener thread (TID = 19).
    [03/16 10:38:54,firefox.exe(1936:1),Framework] BrowserRemoteClient.Disconnect() : Sending ClientDisconnectRequest(ClientId="Client_2c97f56d-585a-4358-9975-233d960ddd64") to pipe server...
    [03/16 10:38:54,firefox.exe(1936:1),Framework] BrowserRemoteClient.Disconnect() : Command pipe is already disconnected.
    [03/16 10:38:54,QTAgent32.exe(2628:19),Warning] PipeCommunication.AsyncPipeRead() : Pipe read wait broken by thread-abort.
    [03/16 10:38:55,QTAgent32.exe(2628:13),DialogPlayback] DialogMonitor.Stop() : Dialog monitoring is being halted.
    [03/16 10:38:56,QTAgent32.exe(2628:18),UIAutomation] AutomationExtensions.RemoveAutomationPropertyChangedEventHandler() : Removed the property change handler on element System.Windows.Automation.AutomationElement scope Subtree.
    [03/16 10:38:56,QTAgent32.exe(2628:18),UIAutomation] AutomationExtensions.RemoveStructureChangedEventHandler() : Removed the structure change handler on element System.Windows.Automation.AutomationElement scope Subtree.


    Is it possible it is connected with a thing called Named Pipes? When test is running on FF and a browser launches I can see on address bar something like "Pipe.ArtOfTest.WebAii.BrowserProvisioner=/and here an integer value/" after about:blank but I cannot see it on InternetExplorer. I feel I did my best to make it work, I read hunderds of posts, I tried dozens of problem solutions but it still does not work, so I hope you can help me.

    Regards,
    Adam
  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 21 Mar 2012 Link to this post

    Hello A K,

    The problem is that our tool requires an administrator level access to function properly in VS2010. As seen in this article(first solution), you always need to run Visual Studio as Administrator in order to be able to launch the browser. Follow this link to see how you can do that.

    Also, have you restarted the machine after you turned off the User Account Control? Sometimes the machine needs to be restarted for the changes to take effect.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. akesy
    akesy avatar
    3 posts
    Member since:
    Feb 2012

    Posted 22 Mar 2012 Link to this post

    Hello Plamen,

    Thank you for the reply. My VS2010 is running as administrator and I have restarted my machine after turning off User Account Contorl. It turned out that probably Primary Interop Assemblies were missing. I have tried to install PIA as a single download but without a success as while installing I was told I cannot install PIA without having MS Office installed. Then, an idea came to my mind to try install MS Office trial version to see whether installing PIA will solve my problem. Apparently, MS Office installed missing libraries and my tests run on Internet Explorer properly now. Do you now by any chance is there any possibility to install PIA without having MS Office installed or it is limitation of MS Office license?
  4. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 22 Mar 2012 Link to this post

    Hello Adam,

    It's not neccessary to have Microsoft Office installed. You'll find the PIA package at the end of this article, just unzip it and run the .exe file. This should resolve the problem. 

    All the best,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. akesy
    akesy avatar
    3 posts
    Member since:
    Feb 2012

    Posted 27 Mar 2012 Link to this post

    Hello Plamen,
    Thank you for reply and advice. Indeed, installing PIA package you have given in the link solved the problem. Thanks a lot!
  6. Jon
    Jon avatar
    1 posts
    Member since:
    Sep 2012

    Posted 30 Sep 2012 Link to this post

    Hi,

    The zip in the linked article doesn't seem to be available anymore, is it still available somewhere?

    -jon
  7. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 04 Oct 2012 Link to this post

    Hello Jon,

    I apologize for the delay in getting back to you and that the download link is broken. We are currently working to fix it as soon as possible. It seems we have a problem with the server hosting the file. I'll update the ticket once the link is fixed.

    Thank you for your understanding and please excuse us for the inconvenience caused.

    All the best,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  8. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 05 Oct 2012 Link to this post

    Hi Jon,

    The link is fixed now.
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/troubleshooting_guide/installation-problems/failed-pia-deployment.aspx

    I have also updated your Telerik points for reporting the issue.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  9. Denis
    Denis avatar
    4 posts
    Member since:
    Dec 2011

    Posted 11 Aug 2014 Link to this post

    Hi Telerik Support Team.

    We are using Telerik Testing framework (without Test Studio and recorder).
    Now we need to migrate to Windows 7 and IE9 (prevously we used Windows XP and IE8). 
    Could you please confirm that we need always run MS Visual Studio 2010 as Administrator to be able to launch IE correctly?
  10. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 11 Aug 2014 Link to this post

    Hello Denis,

    Yes I can confirm that you must run Visual Studio at Administrator level in order for Test Studio to successfully connect to and control IE. Anything less and Windows will block our connection attempt as a "security threat".

    This has always been true and is very unlikely to change anytime in the future.

    We do use a different mechanism for connecting to the other browsers. They do not require administrator level.

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  11. Denis
    Denis avatar
    4 posts
    Member since:
    Dec 2011

    Posted 11 Aug 2014 in reply to Cody Link to this post

    Cody, thank you for your reply. Does it matter if we use Telerik Testing framework, not Test Studio?
  12. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 11 Aug 2014 Link to this post

    Hi Denis,

    No it does not. The same "must be run as administrator" applies to both.

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  13. Alexander
    Alexander avatar
    1 posts
    Member since:
    Aug 2014

    Posted 12 Aug 2014 in reply to Cody Link to this post

    Cody, can you explain in detail why an admin account is needed ?….  What permissions or enabled processes does it have that a non-admin account doesn’t have ?
    What needs to be done to enable non-admins to use this product without having local admin rights ?
  14. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 14 Aug 2014 Link to this post

    Hello Alexander,

    We use special API hooks that are only available in Internet Explorer to attach and inject code into the IE process directly. This gives us speed and full access to the DOM in IE, along with all the internal API's of IE for controlling the browser.

    Windows will only let a user with Admin level privileges the ability to do that. You do not have to logon as THE administrator i.e. the local system administrator account, but simply have the account you are logging in as be a member of the Local Administrators group on that machine... OR, when using Visual Studio, launch Visual Studio "As Administrator" which will prompt the user for Administrator credentials essentially running it at administrator level. There are no permission settings anywhere you can set to allow a non-admin user the ability to allow another program to inject itself into IE.

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top