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

Unable to perform operations on objects under WinObject in .net app

$
0
0
Hi,

I am automating a .net application but unable to identify the objects under "SwfWindow("ABC").WinObject("AfxFrameOrView110")" hierarchy. In the application under WinObject I've to perform click and verify on certain objects but UFT is not recognising any objects.

Note: .net add-in already selected.

Please suggest how to handle this issue.

Need help on excel datatable operations

$
0
0
Hi

I am new to QTP. Need help on excel datatable operations.

I have 4 excel files in a folder. I need to convert all excel files to CSV.

I have written below code, but somehow it wont work. getting error message as "Open method of Workbooks class failed".

Please find below my code:


Option Explicit 
Dim TotRow,i,ExcelObj,Sourcefile,TargetFile

TotRow =  DataTable.LocalSheet.GetRowCount

For i = 1 To TotRow

    Set ExcelObj = CreateObject("Excel.Application")
    ExcelObj.DisplayAlerts = False
    ExcelObj.Visible  = False  
    
''    Sourcefile = Datatable("SourceFile",dtlocalsheet)
''    
''    TargetFile = Datatable("TargetFile",dtlocalsheet)
    
    ExcelObj.Workbooks.Open Datatable("SourceFile",dtlocalsheet)
    ExcelObj.SaveAs Datatable("TargetFile",dtlocalsheet)
    ExcelObj.Application.Quit

Next


Datatable Details:

          Sourcefile                                                [i]TargetFile[/i]

C:\QTP\ExpectedReports\a.xlsx               C:\QTP\ExpectedReports\a.csv
C:\QTP\ExpectedReports\b.xlsx               C:\QTP\ExpectedReports\b.csv
C:\QTP\ExpectedReports\c.xlsx               C:\QTP\ExpectedReports\c.csv
C:\QTP\ExpectedReports\d.xlsx               C:\QTP\ExpectedReports\d.csv


Please Note: If I provide full path of sourcefile and targetfile then code works. but I don't want to enter those each time as there are 1000 of files in a folder which I need to concert to CSV.

Thanks,
Sushant

SwfToolbar and ItemExists with costant or directly string

$
0
0
Hi,
i not found where is the error in following lines:
Code:
str = datatable.Value("menuStrip1_File1","Step 1")
menuItemChildOfFile1 = SwfWindow("MicAnalytics").SwfToolbar("menuStrip1").ItemExists(str)
    
menuItemChildOfFile2 = SwfWindow("MicAnalytics").SwfToolbar("menuStrip1").ItemExists("File;New...")

In watch tool, I see that str is equals to "File;New..."

But:
- menuItemChildOfFile1 is equals to False
- menuItemChildOfFile2 is equals to True

Why?

Thanks.

Connect to IBM MQ using UFT 12.5

$
0
0
Hi,

I am trying to connect to MQ Queue Manager of IBM Websphere MQ using UFT 12.5.
I have provided the Host Name, Port, Channel, Queue Manager Name.
But I am getting the following error "Error in the application."

However, I am able to connect to the same MQ Queue Manager manually using IBM Websphere MQ Explorer.

Can somebody help?

Regards,
Soumen

Parameterization

$
0
0
Hello.. I am new to QTP. I am working in an automation project based on mainframe  I am little bit confused with the concept of parameterization. what is the use of  parameters tab in "Action properties" & parameters value in "Action call properties" ?  

please find below the code-


Code:
IdentifyInput="A"

RunAction "FormatForTenderAndConfirm",oneIteration,IdentifyInput


with the above two lines,I know we are sending a parameter to the action named FormatForTenderAndConfirm  and In that action we are writing the below code 

Code:
IdentifyInput=parameter("IdentifyInput")


Please explain in detail.

[UFT] Get Item of ListBox and convert it to array

$
0
0
Hi,
I have this code:
Code:
listDataItems = SwfWindow("MicAnalytics").SwfList("listBoxExt1").GetContent()
                
listDataItemsReplace = replace(listDataItems22, vbCrLf, ",")
dataItemArray = Split(listDataItemsReplace , ",")

I would replace new line char in listDataItems with comma char.

Why my code not work?

I've tried with vbCrLf, vbNewLine, but nothing.

Help?

Thanks.

How to know the object present in Webtable cell

$
0
0
Can anyone answer the below questions please

1) How to know which object present in Webtable cell
2) Best way to handle dynamic objects whose properties are changing every time At

[UFT] SwfObject as Toolbar: select item without coordinates

$
0
0
Hi,
I have a Toolbar with menu.

If I use the "record operation", UFT creates this code:
Code:
SwfWindow("MyApp").SwfObject("_Form1_Toolbars_Dock_Area_Top").Click 827,9
SwfWindow("MyApp").SwfWindow("SwfWindow_2").SwfObject("SwfObject").Click 56,19

I would not use the coordinates because The order of the menu items could change.

In menu i have: 
Item 1 
     SubItem 1

How can I select SubItem 1?

This is my object:
[Image: uft_sfwObject.png]

Thanks.

Auto Complete list not displayed in PEGA7

$
0
0
Hey All  Big Grin -

I was automating one of the portals which was developed using PEGA7 CPM framework. The page had country auto-complete drop box where typing into the box two or three letters will display list of related countries.

I was able to see the list showing up during recording with UFT 12.0. However, when I play back, the list is not getting displayed

Below is complete code for the page

Browser("Pega 7").Page("Pega 7").WebEdit("UserIdentifier").Set "user3@sedgwick"
Browser("Pega 7").Page("Pega 7").WebEdit("Password").SetSecure "565a7c3c5d52ba74ceb5adf22fa723d1da7d2c5e93a3b2ac"
Browser("Pega 7").Page("Pega 7").WebButton("Log In").Click
Browser("Pega 7").Page("CPMInteractionPortal").Link("New").Click
Browser("Pega 7").Page("CPMInteractionPortal").Link("Intake").Click
Browser("Pega 7").Page("CPMInteractionPortal").Frame("PegaGadget1Ifr").WebEdit("$PpyWorkPage$pClient$pClientNa").Set "golden"
Browser("Pega 7").Page("CPMInteractionPortal").Frame("PegaGadget1Ifr").WebButton("Search").Click
Browser("Pega 7").Page("CPMInteractionPortal").Frame("PegaGadget1Ifr").WebButton("Select").Click
wait 5
Browser("Pega 7").Page("CPMInteractionPortal").Frame("PegaGadget1Ifr").WebEdit("$PpyWorkPage$pCallBackDetails$_4").Set "Ind"
wait 5

Browser("Pega 7").Page("CPMInteractionPortal").Frame("PegaGadget1Ifr").WebEdit("$PpyWorkPage$pCallBackDetails$_4").Set "India"
wait 10
Browser("Pega 7").Page("CPMInteractionPortal").Frame("PegaGadget1Ifr").WebEdit("$PpyWorkPage$pCallBackDetails$_5").Set "9989976892"
Browser("Pega 7").Page("CPMInteractionPortal").Frame("PegaGadget1Ifr").WebButton("Save").Click
Browser("Pega 7").CloseAllTabs


Any clue on fixing this will be appreciated!

Thanks much,

Charan

[UFT] Get column name from SfwObject

$
0
0
Hi,
I have this item in my application:
Code:
SwfWindow("myApp").SwfWindow("RawData.csv").SwfObject("RawData.csv")

It's is a grid, I would like to iterate the columns name.

Which is the better way?

I tried with Object too, but without any results.

Suggestions?

Thanks.

How To use iterations for API

$
0
0
Hi All,

I am fairly new to UFT and I am looking for some advice. Currently I have a API Test which contains several GUI Tests, currently I have the API running two iterations which works correctly but my issue is the last GUI test inputs data from the global sheet, I want it to be able to work its way through the data (a row at a time) with each iteration I perform, it is important though that the GUI tests before this test be run first. I hope this make sense, essentially I want the API test to run however many iterations I want but the last GUI test must change the row it pulls data from. I hope someone can help me with this.

Unable to get properties of JavaObject in contextual menu

$
0
0
Hello,

I am trying to check the property of JavaObject in contextual menu of javaTree.
I cant put standard checkpoint in contextual menu. I am comparing value of a Javaobjects in contextual menu but how to check if a particular object exist in contextual menu or not.
I have below method but actual value in replay is coming out to be empty, and test is failing.


Code:
JavaWindow("ENOVIA Portal -").JavaTree("DocumentTreeView$DndVpmJTree").Select Object
JavaWindow("ENOVIA Portal -").JavaTree("DocumentTreeView$DndVpmJTree").OpenContextMenu Object
wait(2)
JavaWindow("ENOVIA Portal -").JavaMenu("Convert to Multi-sheet").CheckProperty "displayed", 0


Now, in above script "Convert to Multi-sheet" object should not appear in order to pass the test.
In results, its showing value of "displayed" as empty value. I tried putting "" also but still no luck.

I have attached screenshot of result.
Please tell me any possible alternatives for this

Thanks
Amit

.jpg   PrtScr capture.jpg (Size: 34.15 KB / Downloads: 6)

SwfTable and RowCount: Unspecified Error

$
0
0
Hi,
until days ago, I use this sample function:

Code:
rw = SwfWindow("myApplications").SwfTable("dataGridView1").RowCount

for to get the num of rows in this dataGrid.

Today, I launch it and I get "Unspecified Error".

Why?

The dataGrid exists and it has some rows.

Thank.

SwfToolbar and WaitProperty: how get text

$
0
0
Hi,
I have a SwfToolbar.
I would use the WaitProperty for execute an action when the text into changes.

I use

Code:
SwfToolbar("statusStrip").WaitProperty "text", strToFind, 2500000


but not works.

With spy the propertyName text is empty.

Why?

Thanks.

How QTP record/play works on google chrome

$
0
0
Hi 

I am struggling to find the way how QTP record/play works on google chrome. 

I am trying to install add in by seeing the video but no luck.Can anyone help me on this.

DB2 Connect connection with IE 11

$
0
0
I am first timer.   Rolleyes
I have this code to connect to an IBM mainframe via DB2 Connect. It worked with UFT 11.53  and EI 10, I tested with IE 11 and it failed at objConnection.Open strCon. I upgraded to UFT12 same problem. "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")

Dim strCon, SQLStr

strCon = "driver={IBM DB2 ODBC DRIVER - DB2};Database=TestDB2;hostname=DB2CONNSRV1;port=50000;protocol=TCPIP; uid=" & signonuser & "; pwd=" & signonpass

objConnection.Open strCon

How to get rid of this error in QTP?

$
0
0
I am new to QTP and trying to resolve the error. I have used the dynamic method of Descriptive programming. When running the below code I get this error:
"The "[ WebButton ]" object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object."
Code:
My script is:

Set oDesc=Description.Create()
oDesc("title").value="Google"
Set oDesc1=Description.Create()
oDesc1("name").value="q"
Set oDesc2=Description.Create()
oDesc2("html tag").value="INPUT"
oDesc2("height").value="30"
oDesc2("index:").value="0"

Browser(oDesc).page(oDesc).WebEdit(oDesc1).Set 10
Browser(oDesc).page(oDesc).WebButton(oDesc2).Click
I have used "index" property in order for QTP to uniquely identify the object.

Please help.

SwfList: unchecked all items

$
0
0
Hi,
I have this SwfComboBox whin in SwfList (checkbox + label):
[Image: uft_swflist_swfcombobox.png]

I would unchecked or deselect all items of SfwList.

I try with this code:
Code:
listItemCount = SwfWindow("Task List").SwfComboBox("filter_checkedComboBox").Object.Items.Count
        
For iterator = 0 To listItemCount - 1
    itemCurrent = SwfWindow("Task List").SwfWindow("ccbParent").SwfList("cclb").GetItem(iterator)
    SwfWindow("Task List").SwfWindow("ccbParent").SwfList("cclb").Deselect(itemCurrent)
Next

But this code generates one error and if combobox is not open GetItem(iterator) not works.

How can I resolve it?

Thanks.

Strange Behaviour of SwfTable

$
0
0
Hi to all,
in past days, I did automated test on a SwtTable.

For this object I used standard funciont as RowCount, ColumnCount, ActivateCell or GetCellData.

Today all these functions not work.

I had to replace:
rowCount = SwfWindow("myApp").SwfTable(dataGridView).RowCount
with
rowCount = SwfWindow("myApp").SwfTable(dataGridView).GetROProperty("RowCount")


clmnCount = SwfWindow("myApp").SwfTable(dataGridView).ColumnCount
with
clmnCount = SwfWindow("myApp").SwfTable(dataGridView).GetROProperty("ColumnCount")


str = SwfWindow("myApp").SwfTable(dataGridView).GetCellData(r, c)
with 
str = SwfWindow("myApp").SwfTable(dataGridView).Object.Rows.Item(Cint(row)).Cells.Item©.Value

Why?
With Spy Object, the Object is equals, it not changed.

Thanks.

How to set a value if webEdit control is disabled?

$
0
0
very new to any forum including this forum.
unable to find source where i can put my question.
sorry, if this is not suitable place to put question

seeking help for:-

 how to set a value if webEdit control is disable , webEdit control is used for accepting DOB of a traveler.

using this code

Code:
Browser("title:=.*").Page("title:=.*").WebEdit("html id:=ContentPlaceHolder1_rptRooms_rptTraveller_0_txtAge_0").Set "26/Dec/1990"

and getting error "Object is disable"

Thanks
Viewing all 1653 articles
Browse latest View live