Selenium components for Coded UI Cross Browser Testing

Free

Selenium components for Coded UI Cross Browser Testing

(8) Review
Visual Studio
2013, 2012
Download (18,740)
1/31/2014
1.4
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (8)
Q and A (90)
Sign in to write a review
Sort by:

by Srikar Garrepally | September 02 2014

complete information not provided regarding pre-requisites and after installing .msi file already chrome driver exists in the specified folder

by Jian_H | December 23 2013

by tiny apps | October 31 2013


Hi this seems to be a nice replacement for the Feature pack2 back in Vs2010 which just support Firefox 3.6 but this is great start to playback CUIT stuff against WebDrive whihc i think eliminates the burning issues open Desktop session

by Oleg Pantsjoha | May 24 2013

Great add on to Coded UI Testing framework, but unfortunately it seems there are still a lot of issues surrounding it, and lack of support is not helping. Some issue and confusion I've spotted from other users while browsing for solutions with my own issues is with simple installation of the product. Additionally, the version support for different browser is all over the place. I understand that it is also down to individual browser suppliers but i believe issue like those should be dealt prior to release of any product. Overall still a great add on, just requires attention to above issue in order to get 5 stars from users. Looking forward to next update.

by JoeH250 | April 30 2013

You really might want to point folks to a sample or two about making use of this functionality. Without some kind of working example that customers can work with, it's really not going to gain any traction.

For those curious about being able to swap between browsers at will, it turns out you need to set an environment variable in order to do that. I found some now out-of-date material at http://msdn.microsoft.com/en-us/library/jj835758.aspx that has a bit of detail on that.

Overall, this is an improvement over being able to run only on IE, but the amount of work that is needed to do so can be time consuming. For example - if you have anything dynamic on your pages (say, part of the window title changes based on a previous action), you're not going to have a great deal of luck using this.

Also, having to code your own "WaitForAjax" solution is a big hurdle to clear.

Based on what I see so far, my team will be staying with our current Selenium WebDriver framework. We have more control over flow, control detection and selection, and dynamic content handling than CUI has.

Fantastic tool!!!

by Marc Velasco | January 10 2013

Have this working with IE, FireFox, and Chrome browsers on a product using a javascript framework. Depending on your application you might need to spend some time creating a good set of search criteria that gives good performance and reliably finds objects across browsers, in my case many of my properties were dynamic across different builds, sessions, and browser because of the javascript framework being used, but we got it working with some experimentation.

by Nathan.Grant | November 30 2012

Install wouldn't work on my Machine - claimed I didn't have Visual Studio 2012 installed but I have legit Ultimate 2012 + the update running. Had to use manual steps.

Sign in to start a discussion


  • Chrome Driver Exits during ordered Test
    4 Posts | Last post 5:31 AM
    • I currently have an ordered test containing multiple test methods.Each test method contains coded ui methods. 
      After first test is executed the chrome window closes and the other tests do not get run. It works fine in IE and window stays open.
      
      How can I make the chrome window stay open until the ordered test is complete?
    • I am using the chrome driver 
      
      Starting ChromeDriver (v2.8.241075) on port 2477
      [7816:9408:0114/144720:ERROR:chrome_views_delegate.cc(176)] NOT IMPLEMENTED
      [7816:9408:0114/144720:ERROR:desktop_root_window_host_win.cc(746)] NOT IMPLEMENTED
      [7816:9408:0114/144720:ERROR:desktop_root_window_host_win.cc(746)] NOT IMPLEMENTED
      [7076:10160:0114/144735:ERROR:ips_channel_win.cc(405)] pipe error: 232
      
      
    • Hi mairs,
      
      Its a known limitation for non-IE browser. Please check it on below link.
      
      http://visualstudiogallery.msdn.microsoft.com/11cfc881-f8c9-4f96-b303-a2780156628d/view/Discussions/5
      
      Thanks
      Vijay
      
    • Sorry i pasted wrong url ;)
      
      Please check it here:
      
      http://blogs.msdn.com/b/visualstudioalm/archive/2012/10/30/introducing-cross-browser-testing-with-coded-ui-tests.aspx
      
      Thanks,
      Vijay
      
  • Sytem.ComponentModel.win32Execptiom:
    5 Posts | Last post Mon 10:36 PM
    • My test does not even run the Chromedriver.exe an get the following exception
      
      Test Name:	test
      Test Outcome:	Failed
      Result Message:	
      Test method Demo.CodedUITest1.MindaEventsTest threw exception: 
      System.ComponentModel.Win32Exception: The requested operation requires elevation
      
      The error is caused by the DeviceService.Start() and when I hover my mouse over the error message I see the following path
      
      C:\Projects\webdriver\trunk\dotnet\src\webdriver\driverservice.cs
      
      I cant find this on my PC
      
      These test used to work and now it does not do anything. We did recently have a corporate wide PC system update for Windows 7
      
      Please can someone offer a solution to this issue for me as I have exhausted my ideas.
      
      Im using VS 2012 Update 4 and latest Selenium components for Coded UI Cross Browser Testing
      
      
    • Can you please tell us what DeviceService.Start() does? Is devenv/commandline from which you are running your tests an elevated process? Can you please post a sample code? Does a simple BrowserWindow.Launch() work? Also do let us know what version of chrome you are running on.
      
      -Abhitej.
    • Hi 
      I have no idea what DeviceService.Start does
      
      Here is the Stack Trace 
      System.ComponentModel.Win32Exception: The requested operation requires elevation
      Result StackTrace:	
      at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
         at System.Diagnostics.Process.Start()
         at OpenQA.Selenium.DriverService.Start() in c:\Projects\WebDriver\trunk\dotnet\src\webdriver\DriverService.cs:line 146
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowserProxy.ProxyDriverService.<Start>b__b()
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowserProxy.FuncInvoker.InvokeMethod[T](Func`1 function)
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowserProxy.ProxyDriverService.Start()
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.BrowserServices.ChromeBrowserService.InitializeWebDriver(String[] args)
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.InitializeCrossBrowserService(String[] args)
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.<.cctor>b__0(String[] args)
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserService.Launch(Uri uri)
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserFactory.Launch(Uri uri)
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.CrossBrowserFactory.Launch()
         at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.LaunchPrivate()
         at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.<Launch>b__3a()
         at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
         at Microsoft.VisualStudio.TestTools.UITesting.BrowserWindow.Launch()
      
      
      Chrome Version is 37.0.2062.120m. BrowserWindow.Launch does not work!
      
    • This is my test
                  BrowserWindow.CurrentBrowser = "chrome";
      
                  using (BrowserWindow win = BrowserWindow.Launch(new Uri("http://someurl.com")))
                  {
                      //this.UIMap.Openbrowser();
                      this.UIMap.SignIn();
                      this.UIMap.Changedate();
                      this.UIMap.SignOut();
      
                      //this.UIMap.Closebrowser();
                  }
      
      and I run it from the Test Explorer in Visual Studio 2012 under x86 architecture
    • As it turns out I solved the issue.
      
      1.) Run Visual Studio as Administrator
      
      
      A classic rookie move on my part but a good lesson none the less!
  • Is it Possible to use CodedUI test Builder with Chrome browser
    4 Posts | Last post Fri 2:32 PM
    • Hi,
      
      i could not able to use CodedUI test builder with Chrome browser . i am looking only for seeing the properties of the object to confirm type of the application object, hyper link or custom control etc
    • This is'nt a supported scenario. Builder can only be used to inspect controls in IE. Will the chrome Developer toolbar help for your scenario?
      
      - Abhitej.
    • Hi,
      
      Chrome developer toolbar is completely not helped. that is the reason i posted this issue.
      
      Because developers developed a list using ul (un ordered list). this type of list is not available in CodedUI . so wanted to know how CodedUI builder recognizes. In IE it is recognized  as custom object.
    • Chandrasekhar,
      Do you mean HTMLCustomControl? That should remain the same across browsers. Are you seeing any issue with this specific control being of this type? 
      
      -Abhitej.
  • Failed to click on visible object
    2 Posts | Last post September 09, 2014
    • hi,
      
      While clicking the visible hyperlink object "OpenQA.Selenium.ElementNotVisibleException" error is displayed.
      
      
      {"element not visible\n  (Session info: chrome=38.0.2125.24)\n  (Driver info: chromedriver=2.8.241075,platform=Windows NT 6.1 SP1 x86_64)"}
      
      
      Stack Trace:
         at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\WebDriver\trunk\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 1005
         at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 846
         at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 729
         at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\webdriver\Remote\RemoteWebElement.cs:line 810
         at OpenQA.Selenium.Remote.RemoteWebElement.Click() in c:\Projects\WebDriver\trunk\dotnet\src\webdriver\Remote\RemoteWebElement.cs:line 336
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowserProxy.ProxyWebElement.<Click>b__d()
         at Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowserProxy.FuncInvoker.InvokeMethodSwitchingToContext[T](Func`1 function, ProxyWebElement webElement)
      
      
    • Chandrasekhar,
      Can you please point us to a repro of this? We need to know if the right hyperlink control is found by playback. Does a DrawHighlight on the hyperlink control highlight the correct control?
      
      -Abhitej.
  • Installation failed in Windows 8 x64. ..
    14 Posts | Last post September 09, 2014
    • I am having VS 2012 Premium installed on Windows 8.1, 64 bit. When try to install the CodedUITestCrossBrowserSetup it is displaying the following message. Can you help in resolving this issue?
      
      ========================
      Error message as follows
      ========================
      
      To install Microsoft Cross browser testing setup for selenium components, you must have one of the following Visual Studio 2012 or Visual Studio 2013 SKU installed on your computer; Ultimate, Premium, Test Professional, Test Agent, Test Controller, Team Foundation Server.
    • Hi KishoreRavi
      
      Can you confirm what version of VS 2012 you are on. As mentioned in the Description of the plgin-
      Supported versions
      This installer works with VS 2012 Update 4 as well as VS 2013.
      
      Please go to VS-> Help -> About and confirm whether you are on RTM or an older Update. In case you are, we recommend moving to Update4 and using the plugin.
    • Hi Srishti,
      
      Windows 8.1, 64 bit
      
      Microsoft Visual Studio Premium 2012
      Version 11.0.61030.00 Update 4
      Microsoft .NET Framework
      Version 4.5.51641
      
      Installed Version: Premium
      
      When I install the plugin still I get the same error message. 
    • Hi Rubinis,
      Are any other VS versions installed on this machine? Also, can you confirm if you have the following registry entry: HKLM\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\12.0\Premium\. If yes, can you please tell us the value of Version under this node.
      
      -Abhitej.
    • Hi Abhitej
      
      Yes I have other VS(VS2010) installed on my machine. When I checked the registry I see up to this HKLM\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing
      
      Under servicing, I do not have 12.0. I have 10.0, 11.0, 9.0
      
      
      
      
    • Thank you for the response Rubinis
      
      Could you please check under the 11.0 node of the same registry path shared by Abhitej and let me know what the value is. Also, have you tried it out on a machine with only VS 2012 Update 4 (no VS 2010 installed)? Does it work there?
    • Hi Srishti,
      
      I checked the version under HKLM\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\11.0\premimum
      
      version 11.0.50727
      Updated Version 11.0.61030
    • Hi
      I tried at my end VS2012 and VS2010 on one machine doesn't seem to be the issue.
      
      Can you please enable installer logs as shown here :- http://support.microsoft.com/kb/223300/en-us 
      and share the same with us so we can see if there are any issues.
      
    • Hello Rubinis,
      
      Any update on it? Are you still facing the issue? if yes can you please provide info that Srishti asked for ?
    • 2 of us at my company with Visual Studio Ultimate 2013 are having the same install problem.  Here's my registry entries;
      
      c:\workspace>reg query  HKLM\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\12.0\Premium\ /s
      
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\12.0\Premium
          Install    REG_DWORD    0x1
          InstallerType    REG_SZ    MSI
          SP    REG_DWORD    0x0
          SPIndex    REG_DWORD    0x0
          SPName    REG_SZ    RTM
          Version    REG_SZ    12.0.21005
          UpdateVersion    REG_SZ    12.0.30723
      
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\12.0\Premium\1033
          Install    REG_DWORD    0x1
          InstallerType    REG_SZ    MSI
          SP    REG_DWORD    0x0
          SPIndex    REG_DWORD    0x0
          SPName    REG_SZ    RTM
          Version    REG_SZ    12.0.21005
          UpdateVersion    REG_SZ    12.0.30723
      
      
      
      Microsoft Visual Studio Ultimate 2013
      Version 12.0.30723.00 Update 3
      Microsoft .NET Framework
      Version 4.5.50938
      Installed Version: Ultimate
      
      
      I do have this file in a slightly different path than mentioned on the download page; 
      
       Directory of C:\Program Files (x86)\Common Files\microsoft shared\VSTT\12.0\UITestExtensionPackages
      
      07/23/2014  02:27 AM           150,896 Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
                     1 File(s)        150,896 bytes
    • I also have this log file (and several more just like it);
      
      Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor
       Action installexe, location: C:\WINDOWS\Installer\MSIFE8A.tmp, command: /s INSTALLDIR="C:\jre1.8.0_20\\" NOSTARTMENU=0 REPAIRMODE=0
      === Logging stopped: 8/20/2014  7:58:50 ===
      
      Should INSTALLDIR be my jre directory?
    • Sorry, I also should have noted that we're on Windows 7 64bit, not Windows 8.
    • ++++
      I got it installed by opening an Administrator command prompt and running the .msi from that.
    • Glad that worked out Lee. Were you hitting the exact same dialog? 
      
      To install Microsoft Cross browser testing setup for selenium components, you must have one of the following Visual Studio 2012 or Visual Studio 2013 SKU installed on your computer; Ultimate, Premium, Test Professional, Test Agent, Test Controller, Team Foundation Server.
      
      We cant seem to repro this at our end. It would be great if you could provide us (abhitej@outlook.com) with the entire installation logs so we can fix this for good at our end.
      
      - Abhitej.
  • Some functionality is broken after upgrading Chrome to ver. 36
    8 Posts | Last post September 03, 2014
    • Hi,
      Don't know where to open bug, so I'll report it here:
      After upgrading chrome to version 36.xxx, our CodedUI tests stopped working.
      Here is the error message reported by Selenium Component:
      
      Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: 
      TechnologyName:  'MSAA'
      ControlType:  'Document'
       ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
      
      The same code works perfectly with IE8/8/10, Firefox (all versions) and Chrome 35.xxx.
      
      I still can get my code working by:
      1. Setting EqtTraceLevel to 0 (currently it is 4) in application configuration file.
      2. Avoid accessing BoundingRectangle property of UITestControl (it always fails with the above message on Chrome 36 for every control).
      But this would break many of our tests.
      
      Any help would be appreciated.
      Thanks.
    • Hi Igor,
      Can you try performing a browser refresh before accessing these properties. This is a known issue and we are working on it.
      
      - Abhitej.
    • Hi there, I'm experiencing the same exception ("Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties.") when calling Mouse.Click() in Chrome 36. I assume this is because Mouse.Click() depends on the BoundingRectangle. Refreshing the page via BrowserWindow.Refresh() prior to making the call to Mouse.Click() has no effect, the exception still fires.
      
      Stack trace:
      Test Name:	SevereFishhookInEye
      Test Outcome:	Failed
      Result Message:	
      Test method TrainingExercise.CodedUITests.SymptomCheckerTests.SevereFishhookInEye threw exception: 
      Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: 
      TechnologyName:  'MSAA'
      ControlType:  'Document'
       ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
      
      Funny thing, though, further down the trace I can see the lines:
      V, 5784, 14, 2014/08/08, 15:17:48.768, 21398635847, QTAgent32, CrossBrowserPlugin : Search : Trying out search using FindElementsBy
      V, 5784, 14, 2014/08/08, 15:17:48.802, 21398719599, QTAgent32, PERF: CrossBrowserPlugin: CreateCrossBrowserElementInstanceWithoutInitialize.: took 3.0662 ms
      V, 5784, 14, 2014/08/08, 15:17:48.805, 21398727645, QTAgent32, CrossBrowserPlugin: Search: Element matched other search properties.
      V, 5784, 14, 2014/08/08, 15:17:48.808, 21398735348, QTAgent32, PERF: CrossBrowserPlugin: AddXPathToElements: took 0.0078 ms
      I, 5784, 14, 2014/08/08, 15:17:48.809, 21398738518, QTAgent32, CrossBrowserPlugin : Search Successful
      V, 5784, 14, 2014/08/08, 15:17:48.809, 21398738704, QTAgent32, PERF: crossBrowserTestPlugin: Search: took 57.9079 ms
      
      So it looks like Chrome is actually finding the element selected, but the COM component isn't getting what it expects to be returned.
    • I am having the same issue getting the .Top property of my control. The control exists. Any updates on a fix/workaround for this issue?
    • Hi Eduardo and Aaron, 
      We do not have an ETA for the fix yet. 
      As a work-around, before accessing any control on the page, try refreshing the page with-
      
      Keyboard.SendKeys("{F5}");
      Playback.Wait(2000);
      
      We have tested this and it works-around the issue for us.
      
      -Vaibhav
      
    • Thanks for getting back to us Vaibhav. Unfortunately for us that work around wont work because the page were we get the issue is a form and a page refresh causes a confirmation to leave or stay in the page and other unexpected behavior with form values also take place. But maybe we can figure something out to don't need to get coordinates.
      
      The reason we ended up trying to get coordinates is because the inconsistency we observed with mouse.clicks and hovers when the control is off screen. It would work on some machines and not in others; even it would work sometimes and not others.
      
    • Hi All,
      The Coded UI Playback issue on Chrome throwing exception-
      
      Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: 
      TechnologyName:  'MSAA'
      ControlType:  'Document'
       ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
      
      has been resolved on latest Chrome Version 37.0.2062.102 m.
      
      It was an intermittent issue in Chrome and needs no fix/update for the plugin.
      
      -Vaibhav
    • Vaibhav,
      
      Perfect timing with this update. I just updated Chrome to 37 and it is working.  Thanks!
      
      Mike
  • Can latest Chrome version 37 supported
    8 Posts | Last post September 02, 2014
    • my codedui VSTS 2013 test is failed with error - failed to identify the object however the object is present in the application. i seen this issue in Chrome 37. 
      
      Chrome browser is upgrading day by day. so if tool is not supported up to the latest version, no point of testing cross browser testing in old browsers.
      
      we have requirements to test our application with latest available browsers. i feel VSTS should support up to latest available browser every time.
      
    • Are you using the Test Builder to define your object or are you creating the object in code?  If you haven't already, check that the browser window is defined properly (There may be a reference to "IEFrame" as a search property in your designer or Window class) as this would cause the object to fail in Chrome.  Just something I've found.
    • You are correct "IEFrame" is available, but when i remove that property my solution got failed with browserWindow does not contain definition for 'Refresh' and no extension method 'Refresh' accepting a first argument. and 'Refresh'is used 173 times in my entire solution.
    • OK, so the definition to your browser window should look something like this:
      
      BrowserWindow myBrowser = new BrowserWindow();
      myBrowser.SearchProperties["Title"] = <title of your site, or something else that fits>;
      return myBrowser;
      
      That should be enough to identify it.  If the myBrowser.Refresh() isn't an available method for the object, it seems like you're not creating a BrowserWindow object.
    • thanks
      the suggested approach i could not able to use because i am using browser object from UIMap. it is quite difficult to update all the UIMap references with the approach suggested by you.  
    • Even if you used the Test Builder to create your maps, you can still edit the windows' properties by editing the search properties collection.  With your .uitest file open, click on the window in question and hit F4 to open the properties pane, and then click the ellipsis in the cell for Search Properties.
      
      Hope this helps.  -R
    • Thanks RyanCox,
      
      with help of your comments, i drill down properties available in the UIMap and found it has non required properties like TagName,ControlDefinition,TagInstance. after removal of those properties, codedUI started working
      
      
      after that i was blocked at one point , in IE a control is identified as Html.Custom but it seems in chrome it is identified as html.hyperlink (I could not able to find exact name of the object using CodedUI test builder because codedUI test builder is not working with chrome).
      
      
      HTMLControls.HtmlHyperlink oCustom_1 = new HTMLControls.HtmlHyperlink(this.UIMap.UI_MainWindow_AVEVANETDashboard.UI_MainDocument_AVEVANETDashboard);             
      oCustom_1.SearchProperties.Add("InnerText", "Actions...", PropertyExpressionOperator.Contains);
      UITestControlCollection uic = oCustom_1.FindMatchingControls();  // 2 items are retrived here, fter that error shown below is displayed
      
      foreach (HTMLControls.HtmlHyperlink oCustom_2 in uic)
       {
      if (oCustom_2.BoundingRectangle.Width > 0)
         {
      
           Mouse.Click(oCustom_1);
           break;
          }
      }
      
      element not visible (Session info: chrome=38.0.2125.24) (Driver info: chromedriver=2.8.241075,platform=Windows NT 6.1 SP1 x86_64)
      
    • Typo in the code, corrected now. started working fine.
  • Firefox finds the wrong control
    2 Posts | Last post August 21, 2014
    • Working in VS2013, Firefox 26.  I define an HtmlHyperlink:
          HtmlHyperlink target = new HtmlHyperlink(browser);
          target.SearchProperties["class"] = "sizeOptionElement";
          target.SearchProperties["title"] = "Choose size M";
      
      When I `Mouse.Click(target);`, the agent clicks on some other part of the screen instead of the control I've defined.  When I try to highlight the control using `target.DrawHighlight();`, it draws a box around some seemingly random section of the page.  
      
      I am very confused.  This works fine in Chrome 36 and IE11.  Any help is appreciated.
      
      -Ryan
    • I upgraded to Firefox 31 and the WebDriver can now find the control successfully.
  • Cross Browser Testing Issue
    3 Posts | Last post August 15, 2014
    • HI All,
      
      I am doing the cross browser testing using Coded UI. My requirement is to execute the Coded UI Test scripts on Firefox and Chrome browser. I have done all the steps required for cross browsing mentioned below :
      
      1. Downloaded the selenium component for cross browser testing.
      
      2. Copy the net40 folder files to the C:\Program Files (x86)\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components folder.
      
      3. Include the name space Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser
      
      4. Implemented the code : 
      
      BrowserWindow.CurrentBrowser = "Firefox";
       BrowserWindow bw = BrowserWindow.Launch(new System.Uri("www.google.com"));
                     
      
      When I execute the test both in debug or run mode, the script got stuck at second point during launch of Firefox. When I look into Task manager, the firefox.exe*32 process is running. When I close the process then automatically test started running opening a new instance. (Before running the script there is no firefox process running in task manager)
      
      
      Please Help if I m missing any step. Also I am using Visual Studio 2013 Premium edition and Firefox version 29.0.1.
      
      Thanks,
      
      Jatinder Kaur
      
    • Hi Jatinder,
      For firefox tests please close all instances of the firefox browser before playback. Have you installed the MSI? What version of selenium components are you using?
      
      - Abhitej.
    • Hi Jatinder:  To add to Abhitej_MSFT's reply, sometimes a plugin or add-on for firefox will keep a process running in the background, which prevents the Coded UI from launching the browser.  I solved this by disabling the Java Dev toolkit and including in my closeBrowser() method a command to kill any existing firefox processes.  I found this link (https://support.mozilla.org/en-US/questions/817014) to be useful.  
      
      Hope this helps.
      -Ryan
  • Cross browser with Chrome - Browser closed automatically
    13 Posts | Last post August 08, 2014
    • I am trying to cross browser testing with Chrome. Installed the Chrome driver.
      Use below code in my test method.
      BrowserWindow.CurrentBrowser = "Chrome";
      When run the test, it jusy invoke my URL in chrome and get close without executing next test steps. This works in IE.
      
      Can any one let me know the solution, any Driver / browser version combination I need to use ?
    • Hi Patilsudhir,
      Are you running your test as an admin? There is a known issue with navigating in chrome opened as admin process. Can you please run it as a normal user and try. You would be getting  a "Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: The HTTP request to the remote WebDriver server for URL http://localhost:58679/session/c03c325820e1295c76eb5ca2318921e4/title timed out after 60 seconds" in this case.
      If this is not the case what is the version of chrome you are using? Are you able to run the same test on firefox?
      
      -Abhitej.
    • @cra2y80y--
      The current version of the plugin is working with Firefox as well, we have verified that and have hence not updated a newer version of the plugin. Please ensure that you have the latest version of the selenium binaries as well.
      
    • Hi Abhijee
    • Hi Abhijeet I ahave tried without Admin also. Still same issue.
      I amusing Chrome version - 35.0, Chrome driver version as v2.8.241075.
      I amgetting error as Exception caught: Could not locate the browser window, window name not specified.
      
      I am facing same issue with firefox too.
    • Patilsudhir,
      Your generated code seems to have a locate for a launch. Can you paste the code you are using to test here. Also can you make sure that all instances of chrome are closed before running the test.
      Parallely can you just perform a simple launch and navigate and let us know if that is working:
      BrowserWindow.CurrentBrowser = "chrome";
      BrowserWindow window = BrowserWindow.Launch("http://www.bing.com");
      window.NavigateToUrl(new Uri("http://www.microsoft.com"));
      It works for us with the same chrome driver and chrome version : 35.0.1916.153 m.
      
    • Hi Abhijeet
      I have tried with your code for chrome, it first open the command window saying Starting chromedriver, 
      Before inserting the url for bing.com , I observe data:, in the url text.
      also see, text in chrome as ' you are using unsupported command inne flag--ignore certificate error.Stability and security wil suffer.
      Later it navigate to microsoft.com
      but then it gives chromedriver.exe has stopped working.
      
      For Firefox everything works fine.
    • Hi Abhijeet regarding the Chrome driver stopping, it appears sometime.
      Regarding my Code pls see below code. I am using hand coding in which I am passing the property values in the coded it self.
      
      Below is my TestMethod
      public void VerifyCommonLandingPage()
              {
                  string filePath = ConfigurationManager.AppSettings.Get("TestDataPath") + "CommonLandingPageData.csv";
                  string siteUri = ConfigurationManager.AppSettings.Get("OceanSiteUri");
                  string[] linkName = commonObj.ReadFromCsvFiles(filePath, 0, 1);
                  string[] redirectedPageTitle = commonObj.ReadFromCsvFiles(filePath, 0, 2);
      
                  BrowserWindow.CurrentBrowser = "chrome";
                  commonObj.LaunchBrowser(siteUri);
                  for (int i = 0; i < linkName.Length; i++)
                  {
                      commonObj.VerifyLinks("Home", "Home", linkName[i]);
      }
      In this I am verifying the links present on the page. The link name I am passing from excel.
      
      Regarding my actual VerifyLinks method its taking three parameters, browser Name, Document name and the Link name to verify.
      
      Pls see below coded for VerifyLinks method 
      
      
      
                                     
    • Hi Abhijeet any hine.
      Below is my actual Test method which I have written by handcoding.
      
      public void VerifyLinks(string browserName, string docFriendlyName, string linkName)
              {
                  BrowserWindow browser = SetBrowser(browserName);
                  browser.SetFocus();
      
                  HtmlDocument hDoc = SetDoc(docFriendlyName, browser);
                  hDoc.SetFocus();
      
                  HtmlControl hControl = new HtmlControl(hDoc);
                  hControl.TechnologyName = "Web";
                  hControl.SearchProperties.Add("ControlType", "Hyperlink");
      
                  UITestControlCollection collection = hControl.FindMatchingControls();
                  int count = 0;
                  foreach (UITestControl links in collection)
                  {
                      HtmlHyperlink hLink = (HtmlHyperlink)links;
                      if (string.Equals(linkName, hLink.InnerText))
                      {
                          Mouse.Click(hLink);
                          count++;
                          break;
                      }
                  }
                  if (count != 1)
                      Assert.Fail("Failed to find the given link on this page");
              }
    • Patilsudhir,
      The issue with chromedriver is a known issue and I would really encourage you to report this on their webpage: https://code.google.com/p/selenium/wiki/ChromeDriver. What we noticed with this is it happens fairly often during the first few runs but reduces thereafter. Meanwhile we will investigate this further to see if we can fix anything at our end.
      
      -Abhitej.
      
    • Hi Abhijeet we have resolved the issue. The issue is with browser.Setfocus().browser object is of MSAA technology type and setfocus() doesnot works with MSAA technology type. We have removed this and it works.WE have tested it for few methods and working well. For few method may be we need to chnage the object properties.But need a unique method which should work for any browser type. Any way our major issue get resolved.Thanks Abhijet for valuable support.
    • Me too facing the same issue. 
      As per my observation, My web page is not loading fully.
      Are there any way to increase the web driver http request timeout. By default it is 30 sec. If we are able to set it through our c# scripts, it will be very helpful.
    • Hi Ravi,
      
      Apologies for delayed response.
      I think you are looking for PlaybackSettings.WaitForReadyTimeout
      
      Please refer to blog below for details:
      http://blogs.msdn.com/b/gautamg/archive/2010/02/12/how-to-make-playback-wait-for-certain-event.aspx
      
      Thanks, Sarabjot.
1 - 10 of 90 Items