Quantcast
Channel: Micro Focus QTP (UFT) Forums - All Forums
Viewing all 1653 articles
Browse latest View live

[VBScript] Json: get VALUE by NAME

$
0
0
Hi,
I have this Json
Code:
[{
    "SysName": "mySysName1",
    "SysLink": "mySysLink1"
}, {
    "SysName": "mySysName2",
    "SysLink": "mySysLink2"
}, {
    "SysName": "mySysName2",
    "SysLink": "mySysLink2"
}]

How can I get all value of "SysName" node/name?
How can I use ReGex?

This not works:
Code:
Set re = New RegExp


    re.Pattern = "/SysName(.*)/"
    re.Global = True
    re.IgnoreCase = True


For Each m In re.Execute(myJson)


    Wscript.echo m.value


Next

Thanks.

Trouble Getting UFT to Work with Simplified Chinese

$
0
0
Hi all. I'm hoping somebody out there can be of some help to me.

I'm trying to enhance my existing scripts, which were written and work in English, to work with Simplified Chinese. The scripts are used to create a basic case and the only pieces that need to be translated is the drop down values. The lists do not have all of the same values and sort order for each language. So, for example, the English list could have  A, B, C, and D and the Chinese list could have B, C, F, and G. We have been able to successfully adapt and run  these scripts in Spanish, French, German, and Italian.

The method we have used for the other languages is to store all of the values in a local CSV file and do a lookup in the file of the English word when a translation is needed. Below is the code on how we declare in the CSV file and a snip of a row in the CSV file.

My problem is when the Chinese values are read into UFT (v12.02) from the CSV file, they do not match; therefore, no value is selected. In the CSV file snippet, you can see the characters for China are displayed as "中国" but  "涓浗" is what I see in UFT.


Anybody have any thoughts?
Thanks,

Harry


Code:
' Define connection and recordset and read table
    Set objConnection = CreateObject("ADODB.Connection")
    Set objRecordSet = CreateObject("ADODB.Recordset")

    strPathtoTextFile = "D:\UPSData\QTP\Input Data\"
    strFileName = "ECM_LOV_TranslationDecode.csv"
    
    objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _  
    "Data Source=" & strPathtoTextFile & ";" & _
    "Extended Properties=""text;HDR=YES;FMT=Delimited"""

Code:
COUNTRY,Country,CN,China,China,Cina,Chine,China,中国,

Report Viewer showing hundreds of WebElement.Exists?

$
0
0
I've been working with UFT for a couple of weeks now and I'm trying to automate some testing for a Web Application.

I'm using descriptive programming to manipulate the website and I'm doing a very small amount of custom logging to modify the end report.

For some reason I can't figure out, I occasionally get an end report that has about a thousand of meaningless "WebElement.Exist" statements.
[img]file:///C:/Users/b003223/Desktop/Untitled.png[/img]
In all of my code I am grabbing elements through descriptive programming without an object repository via something similar to:
Code:
checkWebElement = Browser("creationtime:=.*").Page("title:=.*").WebElement("innerhtml:=" & inner_html).Exist

I never turn off the original reporter but I do make a couple of additional checks for every test.  Here is the function I use to report:

Code:
Sub assertAreEqual(value1,value2,action)
    Dim compare
    compare = StrComp(value1,value2,vbTextCompare)
    If(compare = 0) Then
        Reporter.ReportEvent micPass,action, "Arg 1: " & value1 & vbCr & "Arg 2: " & value2
    Else
        Reporter.ReportEvent micFail,action, "Arg 1: " & value1 & vbCr & "Arg 2: " & value2
    End If
End Sub



As I write this I find it fishy that my first line of code above is very similar to my issue but that specific line of code runs only once (and in a different test) than where these WebElement statements are trampling me.

Here is the entirety of my test I'm running
Code:
    search_param1 = DataTable("parameter_1",dtGlboalSheet)               'grabs input paramter
    openWebApp()                                                         'Nothing more than opening IE with a specific URL
    navigateToSearchScreen()                                             'Goes through a couple of websites to arrive on search page
    call populateBox("txtSearchId", search_param1)                       'Fills box with search_parameter value
    submit()                                                             'clicks submit button
    result1 = getPropertyValueFromResults("1","Id")                      'Grabs end value shown on screen
    call assertAreEqual(search_param1,result1,search_by1 & " Check")     'Compares end value with input parameter
    closeWebApp(0)                                                       'Closes browser


Any ideas?

.png   Untitled.png (Size: 15.29 KB / Downloads: 1)

IE 11 Download Notification bar identification using UFT 12.52

$
0
0
UFT 12.52 unable to identify IE 11 'Download Notification bar'. Any update on this. I see lot of post on IE 9 and above not identifying it directly. Any patch and any solution for the same.

Windows 7 Enterprise OS and IE 11 combination does identify the winObject, but Windows 7 profession and IE 11 doesn't identify the 'Download Notification Bar'.

Not able to use wild character in string

$
0
0
Hello,

I am having difficulty in defining a string variable.
Its value is dynamic with only one digit change.

Dim Action, string1
string1 = "Actions;"&Action&";Affected Objects (1)"

In above case the the value of digit in closing parenthesis is dynamic.
I want to define string1 such that it will identify string1 for any value in parenthesis.

I tried to use wild character * and # but its not working.
Please help

Regards
Amit

[UFT] SelectRow and Exception

$
0
0
Hi,
I created a new solution for my TC.

Usually, with SwfTable, I use SelectRow command, it works always.

In this solution, where I write:
Code:
dgRowCount = SwfWindow("myWin").SwfTable("dataGridViewSelect").RowCount
dgClmnCount = SwfWindow("myWin").SwfTable("dataGridViewSelect").ColumnCount

SwfWindow("myWin").SwfTable("dataGridViewSelect").SelectRow 1

SelectRow returns me an error:
'SelectRow: Exception has been thrown by the target of an invocation."

The same error there is if I use ActiveCell o other (only in this TC)

What's means?
How can I resolve it?

Thanks.

QTP-Re-executing script after completion of all iterations

$
0
0
Dear Friends,

Below is my script looks like

Statement 1
Statement 2
For I = 1 to RowCount
Statement 4
Statement 5
Statement 6
....
....
....
Next
Browser("Name").CloseAllTabs

Datatable (Global)
Testdata 1
Testdata 2
Testdata 3
Testdata n

(Global) (Action)

Problem:
After executing ALL test iterationS from Datatable (Global) using For Loop, QTP executes last statement "Browser("Name").CloseAllTabs". Then again it starts executing from top that is Statement 1 and re-entering in For loop to re-executing test data given in Datatable (Global)

What I was expecting - I was expecting to stop the execution because all iterations have been completed and script also has executed last statement. However, script cursor moved to very first statement of script and start executing from Top to Botton again.

Please help and let me know if you need further more information

Different Amount for same iteration

$
0
0
How do I get different amount in the below function ? I wasn't to excute this function to run one time but it should loop twice and I could be able to get different amounts.





Public Function (RCategory,StrLogin,StrAmt)
 For iVal = 1 to 2
  Set RObj = Browser(" ").Page(" ").Frame(" ").WebTable(" ")
      RObj.ChildItem(Rcnt-2,6,"WebEdit",0).Set CCUR(StrAmt)
 Next

Objects identifying as WinObjects on IE with QTP/UFT

$
0
0
Hi,

Sometimes, all of sudden I face object identification issues on IE browser with QTP/UFT (Any version) which was worked fine till the day before. Even everything is common and same, the tool starts identify every object on browser as winObject all of sudden instead Browser..Page...web...object hierarchy. I was facing the same issue since years the day I start working on QTP but I don't have the concrete solution for this. Very few times, this issue would be resolved by deleting all browser cookies and restarting the machine. But most of the times, wont be resolved even after doing the system restart number of times. So if anyone provides the correct solution to overcome this issue then it would be helpful to me a lot. 

Thanks & Regards,
Santhosh Kumar.

GWT Add-In usage in UFT 12.51

$
0
0
Hi,

I am working on an application which was developed on GWT framework. Few objects like text box, Check box are getting identified with or without enabling GWT Add-in on the Add-In manager. But there are few objects like list box, button and Radio Group are  NOT getting identified as expected ( WebList as WebTable, WebButton as WebElement) eventhough GWT add-in has been enabled. So, if anyone have worked or have good idea on the usage of GWT Add-in then please share the information.

Thanks & Regards,
Santhosh Kumar.

Chrome Extension UFT Agent for Chrome Browser testing with UFT

$
0
0
Hi,

I am trying to install UFT agent (chrome extension) to identify objects on chrome browser. But under Chrome extensions page when Developer Mode is ON then <Load unpacked extensions> button is disabled even with or without System Admin rights. Please guide me on installation of extension to work with chrome browser.

Thanks & Regards,
Santhosh Kumar.

[UFT] Compare value of List with DataTable

$
0
0
Hi,
in my application I have a ListBox, I get all items with:
Code:
allGroups = SwfWindow("myApp").SwfList("listBoxGroup").GetROProperty("all items")
that it returns me:
"item1
item2
item3
item4"

In my DataTable I insert in one cell this values
"item1
item2
item3
item4"

If I use an easy IF condition, it doesn't work:
Code:
If allGroups = DataTable.Value("groups_to_expected", "Step 1") Then
     ....my code
End If

The conditions is always FALSE.

Why?
Could be an error with new line char?

Thanks.

Path of Flight reservation Window is not recorded in HP UFT 12.52 version

$
0
0
Path of opening the flight reservation window is not recorded during recording in HP UFT 12.52  version... hence during run time error appears.. Please help asap

Script is not generated for windows application in UFT

$
0
0
Hi,
  Script is not generated for windows application (develeped by using wpf) in uft, i was trying with all recording modes, its working for other windows appilcation, but for my application its not working, pease if any bod knows solution please share with me.

[UFT] Fixed web tests with dynamic parts

$
0
0
Greetings,

I am coming from a year of Telerik Test Studio and now looking at HP UFT solution for our project for about a week now. I have stumbled upon a problem that other testing tools also tend to struggle with - dynamic urls. Our url is in a form of <hostname>/controller/action/<order hash>/ where hostname would be parametrized and orderhash should be ignored. So far I have not found a way to make UFT ignore order hash.

Exact problem is that in action that uses one of these pages at first (recorded) run Page object can be found but when hash changes UFT no longer matches the page. Using object repository and setting Create new Page test object for Different test object descriptions but that did not help. I tried to look up to what UFT matches the Page but there seems to be no such method to do so. I tried using a different approach using direct descriptive matching but that just renders object repository useless and hence the reusability of testing locators.

This is really stopping the testing as objects can not matched so if anyone has any hints on how to solve or work around this problem I would be very much grateful.

Best regards,
Janez

edit: updated title with uft

How to create, maintain, and run Business Process Testing Tests and Flows in UFT ?

$
0
0
Hello,

Can anyone help me ? Is this the correct order to create, maintain, and run Business Process Testing tests and flows in HP Unified Functional ?


  1. Fulfill the prerequisites.

  2. View and update test or flow properties.

  3. Add content to business process tests and flows.

  4. Parameterize the test

  5. Iterate components and flows.

  6. Debug and run the test, analyze the run results.
Thanks,

How to use Service Virtualization in UFT ?

$
0
0
Hello,

Can anyone help me ? Is this the correct order to use Service Virtualization in HP Unified Functional ?
  1. Deploy the Service Virtualization Server

  2. Deploy a visualization project

  3. Add a virtualization project to the test

  4. Set the data and performance models for the virtualization project

  5. Use the Virtualization project in a GUI or API Test

  6. Run the test with a visualized service

  7. View the virtualized service details in the run results
Thanks,

HP Printer Customer Support @ www.globalpccure.com/Support/Support-for-HP.aspx

$
0
0
Printer work is to produce hard copy of documents stored in computer. You possibly will come across more than a few troubles at the same time as operating a printer, such as installing as well as configuring, working at slow speed, shows some error message, along with prints are as well brightness and covered with spots. It possibly will be feasible that you don't make out any error message or may not observe a dilemma until your printer is giving you desired prints. You need to check the settings of your printer to make it work normal. First, make sure that printer is connected and turn on as it should be. Now you are definitely require HP printer customer support to settle root cause of dilemma as well as you may cross check whether wire is accurately plugged in or not and check connection status before going with support service.

If you are in front of troubles in your printing device due to virus contamination, you necessitate installing the printer and making each and every possible change in settings. If you are a non-technical human being, you may face a quantity of inconvenience at the same time as installing on computer and this is where HP printer customer support comes for multipurpose.

You can seek for HP printer support from an assortment of online technical support firms. These tech support firms conduct you remotely via Internet as well as deal all issues associated to configuration and setting up of device. Online printer customer service is far much enhanced than on-site technical support as it saves you from soreness of carrying your computer to some service center.

Here are more than a few of features of HP printer customer service @ http://www.globalpccure.com/Support/Support-for-HP.aspx that would apparently catch the attention of yours:

• Anytime, everywhere 24/7/365 access for HP support

• Gain access to your computer remotely, in order to save lot of money and time

• Guides you all the way through procedure of installation and configuration of printer by hand

In case, you undergo uncomfortable to install and configure your printing device then you can go for HP printer customer support, which make available wide-ranging tech support. Their certified technical experts will access your computer remotely via Internet to fix all your problems. As a result make up world of unlimited hassle-free technical support service accessible round the clock right through the whole year.

Test Set Run automatically

$
0
0
Hi Guys,

Need your help to run my all tests which are present in a particular test set in HPQC (12.0) using VB script. I am using below code. I am not getting any error but the tests in QC are not changing their status from "No Run".


set tdc = createobject("TDApiOle80.TDConnection")
tdc.InitConnectionEx "https://almbt12.saas.hp.com/qcbin"
tdc.login "My_UserName","My_Password"
tdc.Connect "Domain","Project"

Set objShell = CreateObject("WScript.Shell")
Set TSetFact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tsFolder = tsTreeMgr.NodeByPath("Root\")
Set tsList = tsFolder.FindTestSets("")

Set theTestSet = tsList.Item(2)
Set Scheduler = theTestSet.StartExecution("")
Scheduler.RunAllLocally = True
Scheduler.run
Set execStatus = Scheduler.ExecutionStatus

msgbox "1"
Do While RunFinished = False
 execStatus.RefreshExecStatusInfo "all", True
 RunFinished = execStatus.Finished
 Set EventsList = execStatus.EventsList
 For Each ExecEventInfoObj in EventsList
  strNowEvent = ExecEventInfoObj.EventType
 Next
 For i= 1 to execstatus.count
  Set TestExecStatusobj =execstatus.Item(i)
  intTestid = TestExecStatusobj.TestInstance
 Next
 Loop

tdc.Disconnect
tdc.Logout
tdc.ReleaseConnection


Thanks in Advance
Santhosh

Row count is always shown as 1

$
0
0
Hi,

I am writing a piece of code to copy data from a web table to an excel sheet. I don't understand why I am getting row count and column count 1. Is there something else that I need to add?

Here is my code:

Dim XL
Set XL=createobject("Excel.Application")
XL.Workbooks.Open "D:\QTP\RailwaysforSurat.xlsx"
Set nsheet = XL.Sheets.Item(1)
row=Browser("title:=.*").Page("title:=.*").WebTable("html tag:=TABLE", "index:=0").GetROProperty("rows")
msgbox row
cols=Browser("title:=.*").Page("title:=.*").WebTable("html tag:=TABLE", "index:=1").GetROProperty("cols")
msgbox cols



This not complete code. I have trouble getting rows and columns count. Please help!

Thanks,
Harry

P.S. I am using this website for the testing "http://www.indianrail.gov.in/cgi_bin/inet_trnnum_cgi.cgi"
Viewing all 1653 articles
Browse latest View live