Practical UFT Interview questions-Part-2

Today i thought of sharing the common practical scenario to excel in Interview of UFT/QTP

Scenario:-

We want UFT to select checkbox in the table corrensponding to company name of “Oracle“.









Dear readers please share your solutions, it will be of great help for buddy job seekers

More Questions?

ufthelp

5 thoughts on “Practical UFT Interview questions-Part-2

  1. First apply table checkpoint on specified table and edit that checkpoint as below

    nIndex=Browser("").Page("").Frame("MainFrame").WebTable("").GetRowWithCellText("Oracle")

    Now Use DP

    Set oChekBox = Description.Create
    oChekBox ("micClass").Value = "WebCheckBox"
    oChekBox ("Index").Value = nIndex

    Browser("").Page("").Frame("").WebCheckBox(oChekBox).Set "ON"

    Hope it will work for this scenario…

  2. nIndex=Browser("").Page("").Frame("MainFrame").WebTable("").GetRowWithCellText("Oracle")

    Now Use DP
    Set chkobj =

    Browser("").Page("").Frame("").WebTable("").ChildItem(3,2,"WebCheckbox",0)
    chkobj .Set "ON"

  3. row = Browser.Page.WebTable.RowCount
    For i = 1 To row
    Company = Browser.Page.WebTable(i,"Company")
    If Company = "Oracle" Then
    Set obj = Browser.Page.WebTable.ChildItem(1, "Check", "WebCheckbox",0)
    obj.Set "ON"
    Exit For
    End If
    Next

  4. Set owt=Browser().Page().WebTable()
    introwcount=owt.RowCount
    intcolcount=owt.ColumnCount(1)

    'GetHeader position for "Compnay" and "Check" text
    For column = 1 to intcolcount Step 1

    If owt.GetCellData(1,column)="Company" then
    CompanyColPos=column

    ElseIf owt.GetCellData(1,column)="Check" Then
    Checkcolpos=column

    End If

    Next

    'Loop from 2nd row to last row of the webtable

    For r=2 to introwcount Step 1
    rowfound=owt.GetRowWithCellText("Oracle")

    If Rowfound<>-1 Then
    Set checkboxobj=owt.ChildItem(rowfound,Checkcolpos,"WebCheckBox",0)
    checkboxobj.Set "ON"
    Exit For

    Else

    "Msgbox "Oracle" does not appear in company list
    End If

    Next

Leave a Reply

Your email address will not be published. Required fields are marked *