Mercury Quick Test Pro and Virtual machines: Works from one client machine but not another - vb.net

I have a virtual machine (VMware) with Mercury Quick Test Professional 9.2 installed. I have a script to test an application, written in VB.NET using the Infragistics library.
If I access this virtual machine using my laptop (using Remote Desktop), everything works fine, the script completes without a problem. My laptop runs XP, with Windows Classic theme.
If I access this virtual machine using another machine (using Remote Desktop), the script starts fine, but stops halfway through, without no error message from QTP, nothing. This machine runs XP, with Windows Classic theme.
One difference between the two setups is the size of the screen, the laptop is 1920x1280, other machine 1280x1024.
The step where the script stops involves checking a checkbox within an UltraWinGrid. The checkbox itself is displayed, is on the screen in both cases.
Has anyone had this problem before, or have any idea why the behaviour is different between the two machines?
Thanks.

OK. I've found the problem. In fact, the script was failing silently because that's what the person who wrote the script told it to do. It couldn't validate something which was off screen, so the script failed.
The problem was the QTP definition of 'off screen'. I have two screens attached to my laptop, the screen for the laptop itself (1920x1200) and another screen (1280x1024). I connect to the VM for QTP using remote desktop, and it uses the settings of the screen for the laptop. This means that when I launch my QTP script, and move it to the other screen, it doesn't fit, so the screen is no longer maximized, and the object is partially off screen, so can't be found.
The fix is simple: in the Remote Desktop, use the Display tab, and set the size of the screen to a size to 1280x1024, and QTP doesn't have any more problems.
Voilà.

If you are not using Expert Mode, and / or are allowing QTP to do most of the work to create your repository objects, then yes it is referencing everything by pixels.
I create all of my repository objects by hand, viewing the source (in the case of automated web-application testing) and using the Object Spy for assistance where needed. I make a point to not have any positioning information as part of my object definition, for the very reason you are running in to.
For the parts of my web-app that interacted with Windows (opening a file to upload, etc.) the Object Spy was essential for the trial and error necessary to create a unique identifier for creating the repository object. But it can be done.
Ex1: File Browse Dialog
text = "Choose file"
nativeclass = #32770 (apparently some Windows VooDoo for a file open dialog?)
Ex2: Filename textbox in Browse dialog:
nativeclass = "Edit"
attached text "File &name:" (more Windows VooDoo? It woudn't work for me without the "&")
Ex3: Open Button in the dialog:
text = "&Open"
object class = "Button"
Good Luck!

Point of clarification: You mentioned that QTP stops with no error message. Does that also mean that the test results log file also has no error message? If the log has any information, that may be helpful in diagnosing the problem. Could you share the lines of code at the point where the script fails?
Also, remote desktop will resize the desktop on the remote machine. Although QTP scripts are not inherently coordinate based, individual statements can be coordinate-based relative to an object. The resolution could be an issue in that regard. For example, imagine you had a line like Button.Click(5, 150) recorded on a higher resolution machine. But if you attempted to play it back on a lower resolution machine, and the 150 is out of bounds of the object on the lower resolution, it could cause an issue.

QTP does not use screen coordinates except as a last resort, if the objects are identified as high level objects (SwfTable in this case) you should be OK, if however QTP doesn't recognise the object it falls back to WinObject and screen coordinates.
If you're using Infragistics then you should know that they extend QTP's support with their TestAdvantage product which will probably solve your issue.
Edit:
#MatthieuF said:
In fact, we use the Infragistics plugin for QTP, and we still have the problem
Can you give me an example of a line that fails?

A few things:
You should be able to debug on the VM easily - just wait for it to stop, go into your object repository, and see if it can identify the object. If no then use object spy to figure out what properties are different between the OSes. If there is a difference then you can always set that property to a regular expression and have it check for both possibilities.
Assuming that isn't the issue we've run into problems using remote desktop with QTP if the Remote window is closed or minimized. For us, it was an issue where the clipboard can not be changed when an RDP window isn't visible, but there could be other surprises when using QTP that way.

Related

Running from shortcut does not perform the same as running through Visual Studio

I created a VS vb.net program that uses the windows media player. The program works great. However when I create a desktop shortcut to the Release/bin folder, some or the videos have issues (don't start right away, blurred for a few seconds, etc). If I go to the folder and run the .exe, it works. If I make a dos.bat file (cd & exec), it works. If I run the shortcut as administrator, it works.
I rather no run as admin, especially not knowing why. I'm not sure why a shortcut is different than a manual run or running from a dos prompt.
Update: It appears that it has nothing to do with the shortcut! I have the shortcut on screen #2, so that is where the program starts. If I drag the window to screen #1 or start it there, Then the program works OK!
When I ran as administrator or dos batch, the program starts on screen #1 regardless of where the shortcut is.
So it appears that the real problem is: It will only run properly on screen #1. Other screens have the display issues. I have (4) screens. 1 & 2 are one model and 3 & 4 are another and smaller.
i think it depends on where your shortcut is located.
for instance, some people make their profile on a network share (effectively your desktop is a network location), so a shortcut on desktop is actually a link to on a network location which normally has permission restrictions.
another case is that the shortcut you created might not have the "Start in" set to the desired place (your bin/debug folder).
so i think it's worth to examine both of above...

App modeller, Identify button not showing up in blueprism spying

I am creating calculator VBO in blueprism object studio.
In application modeller I gave calc.exe path and able to launch calculator, but I am not getting identify option to spy on any element..
In Element, After clicking Launch buttion, identify is appearing for a split of sec and Launch button is coming back instead of Identify
PS- As mentioned in videos and links, I have launched calc via application modeller not directly via windows..
I am using windows 10, BluePrism V.5.0.11.0 versionenter image description here
Windows 10 calculator is complicated case, please consider using different application in your training. For example paint is much simpler to get started.
If you really need to get that going, then you may need to launch application first, using one object, and afterwards use second object to attach and interact with it.
can be two reasons
1. Either your application is not launched properly.
2. Sometimes we face problems with some versions of applications.
The best way to fix your problem is
Edit your settings remove the application path from the navigate stage.
Launch the application separately
Open Navigate stage > Action > Attach
Provide the window title within quotes (example: "Calculator")
Click OK then run the object
Now if you go to application modeller
You will be able to see the identify button under the element.
Hope this will help you.
I resolved this by unchecking "Disable invasive techniques (hooking)".
The Windows 10 calculator runs with process name win32calc which is also located under c:\windows\system32.
So when you launch the application please make you identify the applications process name and its location
I resolved this by circumventing to windows 7 calculator instead of a windows 10 calculator on windows 10.
Link to download win 7 calculator for win 10-
https://winaero.com/download.php?view.1795
This will be installed in the same place as your default calculator.
Inside-
C:\Windows\System32
The name of the app in my case was "calc1.exe" to avoid collisions with the default calculator.
I used this as my base reference app for spying and it worked.
Also note, the hover to highlight button seems to be a bit buggy, try a bit hit and trail to get you required button to be highlighted and mark using "Ctrl+LeftClick"

Simple Chrome extension w/ Context Menu cmds that call VB .net procedures

I'm looking for some input on how feasible it would be to create a Chrome extension that, when activated via toolbar button, adds context menu commands that call procedures (or methods of a class) written in VB.net.
That's pretty much it. At this point, i'd be thrilled to see context menu items that simply display message boxes built in VB.net.
I'm starting with Chrome, but would anticipate replicating similar functionality in other browsers, starting with Edge or IE, then Firefox and possibly Safari. If it's easier to start with another widely used browser besides Chrome, i'd be fine with that.
I've done the obvious google searches, and I can't seem to find an easy-ish place to start. Any ideas?
--edit, just an additional note, the VB.net procedures would be contained in a dll, exe, or other container installed on the client side machine. I'm not trying to execute server side code

Why is my Visual Studio (VB.NET) layout different in Design View vs. at run-time on my home computer, but identical on my work computer?

I've been developing a program with Windows Forms on my work computer in VB.NET using Visual Studio 2013. When I run it on my work computer, the forms at run-time look identical to the forms in design view - the same overall size, the same layout, etc. Here is what it looks like on my work computer - AND when I access my work computer over remote desktop from my home computer.
However, on my home computer, it looks different in design view than at run-time. The form in design view is smaller and labels are misaligned.
Both computers are running Visual Studio 2013 with the same settings. I'm working on a larger monitor at home, but the fact that things look right when I access my work computer over Remote Desktop makes me think it's not my monitor.
My work computer is Windows 7 while my work computer is Windows 8.1.
Things I've tried:
Anchoring/docking the labels, but the layout ends up looking wrong
Changing the AutoScaleMode to DPI instead of Font, but that only changes the appearance at runtime, not in design view, and it still doesn't match design view.
Any ideas?
I figured it out! It was a setting in Windows on my home computer. (Still unclear why it looked right via Remote Desktop, but maybe it uses the remote computer's settings instead of the local one's).
The solution was:
Right click, choose "Screen Resolution"
Click "Make text and other items larger or smaller"
Check "Let me choose one scaling level for all my displays" and set size to "smaller - 100%"
For some reason, on my home computer the size was set to 125%.
After searching for a solution online this worked for me:
this.AutoSize = false;<br>
this.AutoScaleMode = AutoScaleMode.Font;
I put this code on form load and the display remained the same.

Windows-8 & Internet Explorer-10 broke my ActiveX control drawing?

I am experiencing a very weird behavior while running my Active-X control on “Windows 8” OS, and browser “Microsoft Internet-Explorer 10”.
The control:
My Active-X control is very stable product that my company is already distributing for several years between hundreds of happy customers. The control is an ATL custom-draw control, written in C++, and built with “Visual Studio 2008”.
The problem – the drawing disappears:
While I press the link that opens my control for the first time, I can see that my control is being painted gradually (as my data loading is sometimes slow), but eventually all the drawing disappears, leaving a blank white background color where the controls is located.
Using ‘Spy++’ I can see that my control is really there, but all its painting disappear.
If I move the browser or change its size the control will be re-painted, but otherwise it is simply not visible.
I tried to debug this problem and find out who is erasing my drawing.
I came up with the following technique:
Using WinDBG I added breakpoints at ‘user32.dll’ DLL on the following methods: user32!InvalidateRect, user32!InvalidateRgn, user32!FillRect,
I defined these methods to only show stack and continue with to run,
I ran the above problematic scenario,
When the problem happens I am trying to view who called ‘Invalidate’ or ‘FillRect’,
Since all this happens very quickly I am using the ‘Print Screen’ button to freeze the moment
After doing this several times I find that exactly at the time my control disappears the following stack calls ‘user32!FillRect’:
user32!FillRect
MSHTML!memcpy+0x9805
MSHTML!COmWindowProxy::SwitchMarkup+0x468
MSHTML!CMarkup::SetInteractiveInternal+0x428
MSHTML!CMarkup::RequestReadystateInteractive+0x98
MSHTML!CMarkup::BlockScriptExecutionHelper+0xde
MSHTML!CHtmPost::Exec+0x794
MSHTML!CHtmPost::Run+0x1c
MSHTML!PostManExecute+0x5f
MSHTML!PostManResume+0x7b
MSHTML!CHtmPost::OnDwnChanCallback+0x3a
MSHTML!CDwnChan::OnMethodCall+0x19
MSHTML!GlobalWndOnMethodCall+0x169
MSHTML!GlobalWndProc+0xd7
user32!InternalCallWinProc+0x23
user32!UserCallWinProcCheckWow+0x100
user32!DispatchMessageWorker+0x3ef
user32!DispatchMessageW+0x10
IEFRAME!CTabWindow::_TabWindowThreadProc+0x981
IEFRAME!LCIETab_ThreadProc+0x378
iertutil!CIsoWinMsg::PostQueuedMessagesToComponent+0x4b
IEShims!NS_CreateThread::DesktopIE_ThreadProc+0x66
KERNEL32!BaseThreadInitThunk+0xe
ntdll!__RtlUserThreadStart+0x72
ntdll!_RtlUserThreadStart+0x1b
This is consistent.
When examining this stack I found that this message belongs to a window of class Internet Explorer_Hidden, which is window of size zero (0x0), but with a WS_VISIBLE style. This window belongs to the browser.
Does anyone know this phenomenon?
Is it possible that the browser hidden window is causing this problem?
Could you recommend on other approach to try and hunt the stack that is erasing my drawing?
Many thanks for any hint!
Paz Offer
Conclusion:
The bug was in Microsoft Internet Explorer 10
I used Microsoft Support service to farther investigate this problem. Enclosed here are the findings:
Microsoft Support viewed the version of my IE (Internet Explorer) and suggested to first upgrade IE to its latest patch.
As it happens, the machine I was working on was not setup to be automatically updated by the Windows Update service for some time. As part of upgrading IE I had to first update windows using Windows Update service to its latest patches.
During the process of Windows Update the Microsoft Internet Explorer 10 was automatically updated to its latest patch.
Once IE updated the problem disappeared.
In addition, the ActiveX GUI load process became much faster.
The old version of Microsoft Internet Explorer 10, which caused the problem:
Version: 10.0.9200.16384
Update Versions: RTM (KB2718695)
The new version of Microsoft Internet Explorer 10, which solved the problem:
Version: 10.0.9200.16635
Update Versions: 10.0.7 (KB2846071)
Now all is working as expected.
Thanks, Pazo