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

Driver Script to control child scripts

$
0
0
Hi All,

My requirement is that I have few use cases, each use case has 4-5 scripts for a specified browser, it can be for multiple browsers also. 

So now I need a driver script which typically checks for the use case execution status (Yes or NO) and browser type(IE,Chrome,IE+Chrome) and then executes the test scripts belongs to that Use Case. 

So now how to do the mapping between use case and browser type then run the scripts for different browsers.

Regards
Suman

Find a value in SAPGUILabel Screen

$
0
0
I am using UFT 12.02 which is licenced through SAP Solution Manager. The testing is conducted in SAP ERP - EHP7

I am trying to find a value in a SAP GUI Label screen and then click the check box. The value is in column 2 there are no duplicate values and no column headings

A view of the screen is attached.

I have managed to carry out the search function in an SAP GUI Table with

'find the Row number with the correct plant
row = SAPGuiSession("Session").SAPGuiWindow("Change View 'Shipping").SAPGuiTable("Shipping Point Determination").FindRowByCellContent("LGrp", Parameter("LOAD_GRP_1_IN"))
row = SAPGuiSession("Session").SAPGuiWindow("Change View 'Shipping").SAPGuiTable("Shipping Point Determination").FindRowByCellContent("Plnt", Parameter("PLANT_IN"))

but this does not work for the SAP GUI Label screen.

Your assistance will be very much appreciated.

.pdf   SAPGUILabel Screenshot.pdf (Size: 15.7 KB / Downloads: 1)

[UFT] [WPF] DataGrid: get items of ControlTemplate

$
0
0
Hi,
i'm testing a WPF application.

I have the source code:
Code:
<DataGrid.GroupStyle>
    <GroupStyle>
        <GroupStyle.Panel>
            <ItemsPanelTemplate>
                <DataGridRowsPresenter/>
            </ItemsPanelTemplate>
        </GroupStyle.Panel>
        <GroupStyle.ContainerStyle>
            <Style TargetType="{x:Type GroupItem}">
                <Setter Property="Margin" Value="0,0,0,5"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type GroupItem}">

                            <Expander Name="GroupLot" Loaded="GroupLot_Loaded" Expanded="GroupLot_Expanded" Collapsed="GroupLot_Collapsed" BorderThickness="1,1,1,5">
                                <Expander.Header>
                                    <Grid HorizontalAlignment="Stretch">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>

                                        [...]
                                        
                                        <TextBlock Grid.Column="1" FontWeight="Bold" Margin="10,0,0,0" Width="Auto" VerticalAlignment="Center" Foreground="White">
                                            <Run>Description:</Run>
                                            <Run>
                                                <Run.Text>
                                                    <MultiBinding Converter="{StaticResource TypeLot}" Mode="OneWay">
                                                        <Binding Path="Name" />
                                                        <Binding Path="DataContext" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}"/>
                                                    </MultiBinding>
                                                </Run.Text>
                                            </Run>
                                        </TextBlock>
                                        
                                    </Grid>
                                </Expander.Header>
                                <Expander.Content>
                                    <ItemsPresenter Visibility="{Binding ElementName=GroupLot, Path=IsExpanded, Converter={StaticResource BoolToVis}}" />
                                </Expander.Content>
                            </Expander>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </GroupStyle.ContainerStyle>
    </GroupStyle>
</DataGrid.GroupStyle>

I worte this code for get ControlTemplate:
Code:
WpfWindow("myApp").WpfTable("gridLots").Object.GroupStyle.Item(0).ContainerStyle.Setters.Item(1).Value

but, how can I get the expander and the TextBlock into it?

Thanks.

Help skipping around in VB

$
0
0
I'm trying to figure out a way to skip around my scripts based on a variable value.

Say I want to skip to line 149 if something happens in line 4

Is there anything like this available in VB?

ex.

line 1    Call Step1
line 2    Call Step2
line 3    Call Step3
line 4    Call Step4
line 5    Call Step5

Public Func_Step1()
    If then
    Else
        Go to line 3 'this would skip step 2 if something happened.
    End If
End Function

Public Func_Step2()
    If then
    Else
        Go to line 5 'this would skip step 3 and 4 if something happened.
    End If
End Function

I could handle it with a global variable and an if statement around each function call, but I'd rather not add all that code.

any suggestions would help.

thanks,
Brian

webedit not identified

$
0
0
webedit class in search bar(google browser) not identified  my QTP 12.53. but it identifies the same in yahoo browser. please anyone clarify me on this.
i am using IE11 and QTP 12.53

Not able to set value in application web edit box

$
0
0
Hi All,

I am trying to enter value in web edit box through QTP, set value using QTP displaying in respective box but application treating as no value present in edit box. Please suggest how to resolve this problem.

Using QTP 10, IE11
FYI. I am able to login via enter username and password and able to click available web button also using QTP.


Every input is appreciable.

How to get the Webelement object name.

$
0
0
Hi All,

I am new to UFT and very much new to web browser automation.

So , I want to store the webelement name in a variable. 
(Need: I need to get the UTC time increment value from google. Im googling with "BKK time". And there will be a value like this - "GTM+7". And I need that "7 " value. I am trying to store this value in a variable.)


 Im trying the this:
================

Code:
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "https://www.google.com"


Browser("Google Search").Page("Google Search").WebEdit("Search").Set "BKK time"
Browser("Google Search").Page("Google Search").WebEdit("Search").Submit
Browser("Google Search").Page("Google Search").WebElement("(GMT+.*)").highlight

 val = Browser("Google Search").Page("Google Search").WebElement("(GMT+.*)").{****}


print val


====================
What can I replace {****} with to get the required information.

Please help me .


Thanks,
Shilpa G

Automation Testing On Beta Version of Browsers

$
0
0
Hello, 

I have a specific requirement.

I have a bunch of functional test cases that we execute against beta version of browsers (IE, Chrome, Firefox). Any suggestion on which tool will be suitable for such a scenario. 

E.g - UFT 12.52 supports Mozilla v42 - v44. Now the we have Firefor 48.0 beta available. Will the scripts run on Firefox 48.0 ?

Regards,
Manmayee

Get numbers inside all webelements in webtable and sort them

$
0
0
Hello guys,

I have attended QTP interview @broadridge hyd he asked me this question

webtable was there 3 rows 3 columns inside webtable all are webelemnts and 9 numbers(3,1,9,4,7,2,6,5,8) were there inside these webelements.we have to retrieve all these 9 numbers and sort them.

I have written this below code please check once and let me now anything wrong and if any better solutions for this.

set wb=browser().page().webtable()
rc=wb.rowcounnt
For i = 1 To rc
    cc=wb.columncount(i)
    For j = 1 To cc 
        txt=wb.childitem(i,j,"Webelement",0).getroproperty("innertext")
        a=a&txt&";"
    Next
Next
b=split(a,";")
For i=0  To ubound(b)
For j=0 To ubound(b) 
    If strcomp(b(i),b(j),1) < 0 Then
        temp = b(i)
         b(i)=b(j)
         b(j)=temp
    End If
Next
Next
For i=0 To ubound(b)
    msgbox b(i)
Next

UFT doesn't recognize object in SAP at first, but recognize it after i click debug

$
0
0
Hello,

I work on UFT 12.52 build 6851 with SAP 730
I already have some tests, and now i want to create a test that will launch SAP and login. When i get to the connection window, UFT cannot recognize the object.
What is really weird is that if i click on debug and then just after click the play button UFT will recognize the object.
Moreover, i noticed that if the SAP Logon window is already opened, UFT will find the connection at first try.

Thanks a lot for any insight you might have,
Cédric.

Error message :
[Image: 123741Capture.png]

My object repository is as follows, i can show you the other objects but the error message speak about the "session" object :
[Image: 47732461OR.png]

My code really isn't that particular, but if you need to see it :

Code:
If DataTable.GlobalSheet.GetCurrentRow = 1 Then
reporter.ReportEvent micDone,"Version", "Utilisation of action : '" & actionName & "' in the version : '" & version & "'"

SystemUtil.Run "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe","","C:\Program Files (x86)\SAP\FrontEnd\SAPgui",""   'Open SAP
Dialog("SAP Logon 730").WinListView("SysListView32").Activate DataTable("Server", dtGlobalSheet)  'Open the connection to the desired server
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Client").Set DataTable("Client", dtGlobalSheet)    'Line that gets the error
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("User").Set DataTable("User", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Password").Set DataTable("Password", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Logon Language").Set DataTable("Language", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SendKey ENTER
End If

VB Script to separate upper & small Letters from a string and store in excel

$
0
0
VB Script to separate upper & small Letters from a string and  store in excel

How to automate/record Firefox browser using UFT

$
0
0
Hello All,

Any idea on how to automate/record Firefox browser web page using UFT.





Thanks,

Copy folders from ALM

$
0
0
Hi,

I need to develop a uft script to copy folder contents of reports in ALM from Dashboard/Analysis View/Public fodler in one project and past these folders to another project in ALM. Is there a way to perform this task using UFT. Alternatively I would appreciate it if you could give me sql query that will accomplish this task if it is not possible to do it through UFT.

Thanks,
Shabeer

How to know UFT Qt-Addin Version

$
0
0
Hi,

1 . i am using Qt based application i am using Qt 5.5 version
2 . i want  automation testing tool for that i installed UFT 12.53 version
3 . the question is how to know the which version of Addin comes with UFT 12.53 version? is that Qt 5.3 or Qt 5.5? 


please suggest me how to know the addin versions?

Few Interview Question asked in various Companies..

$
0
0

  1. if a webpage contains number of texts and corresponding text boxes and these values shuffle everytime. I need to write some text in text box for values
  2. matching the search criteria and it is not webtable. How to code?
  3. How will you optimise the test cases?
  4. How many scenreios do you add in every release for automation?
  5. If a function is called in a program multiple times, and new functionlity is added by developer and it is to be checked before a function call. How and where will you code?
  6. How to count the number of rows fetched from database?
  7. In a webtable I have multiple checkboxes in particular cell, how would I select the specific checkbox which are dynamically changing?
  8. On a page I have a button and a new button is added everytime I click on previous button. How would I click the last button and check that new button is added?
  9. I have a string and I need to fetch a character without using the build in functions, how can I do that?
  10. I have 5 table on a page and it do not have any unique identifier, how would I select or enter the data in my own created table?

Reading XML Data from a WebPage

$
0
0
I have WebPage in which I have an xml content .I need to read all the values and modify.Can you please help me with this.

.png   Untitled.png (Size: 21.8 KB / Downloads: 5)

Descriptive programing

$
0
0
Hi I am new to uft and joined in one company. .. I got one task where in that screen there is one search option if I'm enterin any name with keyword all the names which are starting with that letter are sorting so now I need to write the script for this can anyone help me it's urgent

How to edit a text in aParagraph

$
0
0
Hi,
I have a WebPage which has a paragraph of about 400 words.
I need to change a word everytime i process it.

How to do it.

UFT 12.53 trial version not recognizing its sample flight application login/password

$
0
0
Hi,

I have downloaded UFT 12.53 trial version on my windows 10 touchscreen laptop. I tried to read its sample flight application's Login window's "login and password" objects directly into OR (through add objects to local option in Object Repository).What I keep getting is "The location you clicked is associated with several objects.Select the required object from the tree below" but only "Window : HP MyFlight Sample Application" object with no child to select is showing in the object selection pop up.
What could be the reason?

Thanks
Neha

VBA Code to read a substring

$
0
0
Hello All 

I am new to automation using UFT and new to programming as well. My question is around how to manipulate Substrings (a string within a string)
I want to find the position of a certain character in the string and find its start position and pass this start position to the mid function to capture the 
substring. The reason I need the position is because the position of the substring keeps moving. 

I also have it in a Do Loop Until 

Do
Window("Warehouse Management.ws").Type  micF5
Wait (2)
Window("Warehouse Management.ws").WinObject("Workstation ID:").Output CheckPoint("Workstation ID:_2")
L_Sline2 = DataTable.Value("G_Status_20",Global)
L_Status_20 = Instr(L_Sline2,"20 Print")
L_Status_20_Valid = mid(L_Sline2,L_Status_20,8)
Loop Until L_Status_20_Valid = "20 Print"

I keep getting the error "invalid procedure call or argument: 'mid'" The line with the error is underlined 

Could someone take a look at this one please......
Viewing all 1793 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>