Run multiple test opening mutilple instances of windows application(VB .NET) using one UFT instance - automated-tests

Application Under test is developed using .net vb .
Clarification 1 :
is it possible to run multiple tests parellel using one instance of UFT in a one machine ?
Clarification 2 :
Can we open multiple instances of the windows application and run different tests on each instance of the the opened windows application in parellel .

This will not workout with windows application. Even the application is minimized the objects will not be able to identify with UFT until the window is activated. Both the criteria will not work as the objects are just like that identified by their properties not by creation time as we use it for browser. Only option is running multiple test cases in multiple machines

UFT doesn't support running tests in parallel. Note that UFT simulates users, each tests assumes it controls where the focus is (sometimes by taking control of the mouse and keyboard for typing). If multiple tests are trying to do this you may get unexpected results just like you would if you had two mice connected to your computer and two people tried to do different things at the same time.
Consider the following two tests:
Test A
Click username edit field
Type "hello"
Test B
Click password edit field
Type "world"
When run in parallel you may get:
Click password edit field
Click username edit field
Type "hello"
Type "world"

Related

How can I set <UFTApp>.<TestOrComponent>.Settings.Run.OnError non-programmatically for interactive (i.e. IDE-based debug) runs of a BPT component?

In UFT 14.50 (but I don't think this is version-specific), I face the following problem:
For action-based GUI tests, I can configure for each test using File/Settings/Run what should happen in case of error:
For BPT GUI-based components, I cannot; there is no "Run" section:
Also in the application area for the component, which would be the second place where it would make sense to put this setting, there is no such setting.
I do understand that I can set this setting programmatically using <App>.<TestOrComponent>.Settings.Run.OnError.
I also understand that one can configure this setting in the execution setting for each component call in a BPT test flow script, or BPT test script, but what about interactive component execution for debugging reasons -- I have to change this setting in every component programmatically during runtime if I want to define/change this setting when doing debug runs in the UFT IDE, is this correct?
Bonus question: What is the rationale to hide this setting for a given component?
It's a good question. It's one i had to think about as there are quite a few components involved.
You build your code for BPT application areas in UFT but the BPT test itself is designed to be managed and executed from ALM. Around version 11 or 12 HP (the vendor at the time) updated the remote agent to have "debug mode" (the top option in these settings):
If you've not seen this you window, you get it from right clicking on the remote agent on your system tray:
(you can also set it by updating the mic.ini file - shout if you need more info on this)
I've not used BPT for about a decade, but that option in the remote agent I am very aware of. POTENTIALLY The run option you're after doesn't exist because, for BPT and it's aLM dependency, it's now all controlled through that debug run setting.
With it CHECKED, when you run a test from ALM you get the popup on error
With it UNCHECKED, when you run a test from ALM, if it hits an issue the error popup is suppressed.
You don't need to set your options programatically.
Bonus points answer: Logically this makes sense as you're potentially kicking off an entire test set from ALM and if you had 1 bad object/line in the first test and it blocked an entire overnight run you'd be fairly angry. At least this way you have your local machine as a deubg run but all remote execution machines have it unchecked so they just keep going. It becomes a machine configuration and not a script configuration.
If this doesn't work as you expect there are other ways of using a common function library with environment variables to set all to debug or all to carry-on mode.

How to select specific element in Powerbuilder window using HP UFT

I am trying to record/automate an application developed in Sybase' Powerbuilder. I am currently using HP UFT v12.54.
Using the default recording process, the object spy is only seeing the area on my PB Window, not the specific field/dropdown. In short, I am unable to select a specific object in the window.
Please see the following image:
I am trying to select the Authorized Signatory field, but instead, UFT does not see the specific element, but the field area Customer Data instead. UFT just references the fields in the area by xy axis, not the specific object. Is this the default behaviour?
Additional info:
Application is developed in PowerBuilder v11.5
Any input would be appreciated.
if the first impediment is the modification of the application made in PB, then the next option would be to use a third application that supports applications made in PB. There is the TestComplete application that can do what you need. I leave you some information links.
http://testingbaires.com/testcomplete-automatizacion-de-testing/
https://smartbear.com/product/testcomplete/overview/
https://support.smartbear.com/testcomplete/docs/app-testing/desktop/power-builder/classic.html?q=powerbuilder#supported-powerbuilder-versions
I would personally modify the PB application by creating a module with the necessary battery of tests and running the study window with each and every case and applying an output report based on the needs, I understand that it would not be complicated.
The PowerBuilder's DataWindow control is a special custom-drawn control that cannot be accessed from outside of a PB application. It is internally managed and PB dynamically (re)uses the same windows edittext to get the input for one value at a time, while only drawing the rest of the data without using standard windows controls but a kind of canvas.
This is due to the initial portable design of PB (it used to be available for Solaris, MacOS and some other unices in the past) that implies a virtual machine like for Java (hence the pbvmxxx.dll for PB virtual machine).
I am afraid that from the outside, the only option to pilot a PB application would be to use sendkeys and mouse clicks, provided that the taborders are correct to access sequentially all the DW controls.
This is not the default behavior of UFT with power builder applications, you should either see a PBWindow Object or Proper Powerbuilder objects in the Object Spy.
According to the PAM, UFT 12.54 supports Powerbuilder 11.5+.
Below are the few things you can try
1) Make sure all of the latest patches are installed
2) Try to use record and run settings to open the power builder application. Once Record and run settings are set, click on record button and UFT will open the application. Then stop the recording, open object spy and check if its recognizing the objects after that.
3) Run UFT as admin. UFT needs the same privilege level as the application. So if you're application is running in higher privilege then UFT then UFT will not be able to recognize anything on the application.
If nothing works then you can open a ticket with HP, because powerbuilder 11.5 is supported by UFT 12.5.

Using IIS Express for Local Web Application with Multiple Users [duplicate]

I have a line of code that I can run locally as part of a service that works perfectly fine.
sReportPath = objCrystalUtils.ExportReportToPDF("Report Name", iReportInfoID)
This code is run as a part of a service, and when I unit test it by feeding it data, it ultimately builds the report and prints it.
When I run the exact same piece of code inside an .ashx from an ajax call. The reports are generated (I can see the pdf files being created on disk) but the printing is not happening.
oRpt.PrintToPrinter(objReport.DefaultAutoPrint, True, 0, 0)
In both scenarios the same code is used to print the report. (objReport.DefaultAutoPrint = 0 in both cases)
My only thought is that the location of the code that is calling this method is in a different spot relative to the location of the bills themselves.
The printer that I'm trying to print to is a network printer intalled on my machine, and I'm running Windows 7 IIS 6.1
Any thoughts?
Edit:
Here is a thought... if I'm running one as a unit test locally and im running the other through a web app that is running via IIS, is there a difference in user id and user access to the default printer?
Edit:
So I added my local ASP, IUSR and SYSTEM users to the printer security and allowed them to print... no dice. So I checked the EVERYONE user and it is set to access and NO users are denied... so I think that kinda kills that line of reasoning.
Edit:
I changed the name of this post since I no longer think that the issue is ajax related since If I try to do the same process in code bebehind from a post back instead of running it from an ajax call i still get the same problem.
Patrick, for me it is a known issue of crystal reports, printing a certain report from a running application via IIS.
I got the same issue before, and upon our search for that issue, we got the following;
Report to be generated, exported, and then to be downloaded to client machine,
so user can print it locally (say, report will be exported as PDf file,
user can use print option of PDF reader).
It's not Crystal Reports or other third party app's problem. It's usually the IIS_IUSER's permission problem because it has no access to any network printers. A possible solution is in Process.Start doesn't work in IIS

Launching of process on mac using Qt

i am working on sample applications using QT on Mac and i found out problem with one of its API. I want to run process so i am using following function
QProcess::startDetached();
And i am passing program(location of exe )and argument list as parameter now problem is that if the application is allready running then the this will create another process and runs it where as when i cross cheked with Windows its behavior is different in the sense that it does not start application which is allready running. can anyone help me how to fix the issue??
I think, it depends on the application properties. On window you can open multiple Doc files but cannot open Window Media player in two different (new) window.
So, First try opening a new application while its running. If its success, then it should work with QProcess .

Determining the port a Visual Studio Web App runs on

I've been using the macro from this blog entry for attaching the Visual Studio debugger to an already running instance of the Web Application I'm currently working on. However, if I have more than one instance of the Visual Studio web server running it's pot luck which one it'll attach to.
Is there a way to determine what port is configured in the Web project so I can modify the macro to filter its choice of process to that one?
Further Info
I'm aware that you can set the port number to a static one - I've done just that from the get-go, what I'm trying to determine is how to programatically determine the defined port-number so I can modify the macro (in the linked blog entry) and ensure it connects to the right instance of the Visual Studio web server.
The way I have things running is I have two (or more) instances of Visual Studio running, each of which contains a Solution, which contains a web project and one or more other projects - typically an Installer project), so when I trigger the macro from a given instance of Visual Studio, I want to find the Web Project within that instances loaded solution and determine the port it's running against.
This code will get you a list of all ports for the projects in the current solution:
Sub GetWebProjectPorts()
Dim ports As String
For Each prj As Project In DTE.Solution.Projects
For Each p As EnvDTE.Property In prj.Properties
If p.Name.Contains("DevelopmentServerPort") Then
If Not String.IsNullOrEmpty(ports) Then
ports += ","
End If
ports += p.Value.ToString()
End If
Next
Next
MsgBox(ports)
End Sub
If that can help you, I have found a link that might actually to the trick.
However, it require DllImport call and a lot of fun.
You can take a look at that article there: http://bytes.com/forum/thread574901.html
Quotes from the actual site:
By calling into iphlpapi.dll using
PInvoke interop. Google around for
GetExtendedTcpTable and iphlpapi.dll,
I'm sure you will find some existing
stuff.
Willy.
And one last:
Here are some API-Methods for my
purposes:
GetTcpTable()
AllocateAndGetTcpExTableFromStack()
GetExtendedTcpTable()
I wrote a small programm that is able
to show me all Processes with the
belonging TCP-Ports (with
AllocateAndGetTcpExTableFromStack())
running under Windows XP.
Now my problem is, that under Windows
2000 I can't use
AllocateAndGetTcpExTableFromStack() or
GetExtendedTcpTable() so I'm only able
to use GetTcpTable() to list all
TCP-Ports but without the belonging
processes.
Did somebody have the same problem or
is there another way (.Net or WMI
etc.) to solve my problem?
Thanks in advance,
Werner
If you go to the properties for your web project and look under the "Web" tab, you can specify which port the project will always start up on. Then you can click "Enable Edit and Continue" so you don't have to stop debugging and restart continuously.

Resources