Tuesday, April 18, 2017

Web Performance and Load Test - the Web Test Recorder plugin loads but controls are grayed out in Windows 10 with IE 11

I had an issue with IE 11 where the Web Test Recorder was loading but all controls were grayed out.

I verified the “Web Test Recorder 14.0” and “Microsoft Web Test Recorder 14.0 Helper” add-ons were enabled in IE.

Then reset and restarted IE under (Tools> Internet Options> Advanced>Reset).  After that all IE add-ons were then disabled.  I re-enabled the Web Test Recorder add-ons when prompted. 

That resolved the issue with the controls being grayed out, but then I was getting a missing DLL exception clicking Pause or Stop during the recording: "System.DllNotFoundException: Unable to load DLL 'Microsoft.VisualStudio.QualityTools.RecorderBarBHO100.x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

This site said to copy the DLL to the IE folder to resolve the missing DLL exception.
Copy Microsoft.VisualStudio.QualityTools.RecorderBarBHO100.dll (For older versions RecorderBarBHO90.dll  etc)  located under C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies

To – C:\Program Files\Internet Explorer and for 64bit machines also Copy To – C:\Program Files (x86)\Internet Explorer

I copied the DLL to the IE folders and the issue is now resolved.

Friday, April 24, 2015

Execute the TestComplete TestExecute module remotely on a VM using PSExec

Using the SysInternals tool PSExec.exe to launch TestExecute and run a project on a VM.

  1. Login to VM as normal user
  2. Run PSExec from command line (or batch file) on local machine.  I was having trouble with this; needs to be username not in quotes and password in double quotes.
C:\SysInternals\PSTools\PsExec.exe \\TESTVM -u domain\user -p "P@$$w0rd" -i \\TESTVM\C$\Users\testaccount\Downloads\TestExecuteRemote.bat
  1. User launching PSExec.exe is the same user logged in to the VM (without admin rights)
  2. -i option executes interactive
  3. TestExecuteRemote.bat contains command line to call TestExecute that looks like this:
:: Run TestExecute and export log to c:\LOG\ExportLog.mht
:: Log file cannot exist or test will fail to run
:: Test account needs write permission to the project folder (log is also generated under project)
"\\TESTVM\C$\Program Files (x86)\SmartBear\TestExecute 10\Bin\TestExecute.exe" \\TESTVM\C$\Test\ProjectSuite1\ProjectSuite1.pjs /r /e /DoNotShowLog /ExportLog:\\TESTVM\C$\LOG\ExportLog.mht

PSExec.exe has an option for -l to run as limited user, but the remote batch file failed to run using that option. 

Sunday, January 4, 2015

STEP #6: Add Custom Assertion to UIMap1.cs file that verifies properties of an HtmlHyperlink add call to assertion method and code to log messages using TestContext.WriteLine to CodedUITestAmazon.cs

Expand UIMap1.uitest in solution explorer to see the two files: UIMap1.cs is where we add the custom code and UIMap1.Designer.cs contains generated code which is just the definitions of the controls on the page in this case

Double Click UIMap1.cs and UIMap1.Designer.cs to open both files and copy using directives from UIMap1.Designer.cs to UIMap1.cs

Add custom Assertion Method to UIMap1.cs that validates properties of an HTML Hyperlink

Add call to Assertion Method to CodedUITestAmazon.cs and log messages using TestContext.writeline in a new [TestMethod]

Select Build>Build Solution

Open Test Explorer under Test>Windows>Test Explorer

Select Test Method name, right click, and “Run Selected test”

Test Runs: Loads IE to validates properties of hyperlink and logs messages to Output: result is displayed in TestExplorer

Click Output link to view messages that were logged

STEP #5; Add code to TestInitialize section of the CodedUITestAmazon.cs file that loads IE, browse to URL, and log message

Click + sign to expand region named “Additional Test Attributes” where the TestInitialize section is located in CodedUITestAmazon.cs file

Select [TestInitialize] code and uncomment using toolbar button

Add code to launch a new browser window and log a message using TestContext.WriteLine

STEP #4: Add the Using directive and Constructor to the CodedUITestAmazon.cs file

Open CodedUITestAmazon.cs file - double click in Solution Explorer
Add using directive to enable calls to custom methods and assertions that will be added to the UIMap1.cs file

Scroll to the end of the file to add the Constructor to make a new instance of UIMap1 named UIMap after “private TestContext testContextInstance”

Friday, January 2, 2015

STEP #3 Add Controls to UIMap1.uitest - this is a partial class so the generated code will be added to UIMap1.Designer.cs and we'll add custom code to UIMap1.cs

Load IE and browse to
Go back to Visual Studio, right click UIMap1.uitest and select “Edit with Coded UI Test Builder” and the builder loads in the lower right corner with open in IE

Left click and hold down the Cross Hair button, then drag to highlight the control to be added to the UI Map

Click the double arrow in top left corner and the UIMap is displayed

Click button in upper left corner to add the control to the map

The checkmarks turn dark gray but the UIMap has not been updated yet

Click the Generate code button to add controls to the map

You are prompted that there are no code changes except updates to the UIMap

Click Generate button and close the builder to return to Visual Studio
Double click UIMap1.Designer.cs and search for the control that was added - This tells you which properties the tool uses to identify the control on the page

UIMap1.Designer.cs contains the generated code that gets overwritten each time the solution is built

STEP #2: Rename the default CodedUITest1.cs file and dependencies

Right click CodedUITest1.cs file in Solution Explorer and rename to CodedUITestAmazon.cs
Hit Enter and you will be prompted with message: “You are renaming a file. Would you also like to perform a rename in this project to all references to the code element ‘CodedUITest1’?”

Click Yes and name is changed where the green indicators are displayed in the left column

You can also rename in the comments from CodedUITest1 to CodedUITestAmazon