Highlighted
Visitor.
328 views

Select a row from data table

Can some one please help me how to select a row from datatable. My data table consist of 5 rows. I was practising in the newtours site. The code used is 

If Browser("SelectFlight").Page("SelectFlightPage").WebTable("DEPART").Exist(10) Then
 
    totalRows = Browser("SelectFlight").Page("SelectFlightPage").WebTable("DEPART").RowCount()
    For RowNum = 1 To totalRows
        If aDesc = Browser("SelectFlight").Page("SelectFlightPage").WebTable("DEPART").GetCellData(RowNum,2) Then
            Browser("SelectFlight").Page("SelectFlightPage").WebTable("DEPART").ChildItem(RowNum,2,"Airlines361",0).click
        End If
    Next
End If
Browser("SelectFlight").Page("SelectFlightPage").Image("reserveFlights").Click

Please confirm

0 Likes
4 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: Select a row from data table

You haven't stated what the issue you're encountering is, is it the If statement or the clicking on Airlines361?

Mark Smith

0 Likes
Highlighted
Visitor.

Re: Select a row from data table

its on the click of airlines361

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Select a row from data table

I don't have the flight web app installed so I can't try it myself, what I would suggest is recording a click on that cell and verifying the row,clumn and properties are the same as those you are using.

Mark Smith.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Select a row from data table

Hi there.
This does not do anything?

Browser("SelectFlight").Page("SelectFlightPage").WebTable("DEPART").ChildItem(RowNum,2,"Airlines361",0).click

Please try running this command before, and then your click command.

    Setting.WebPackage("ReplayType") = 2  ' mouse events

    <your code comes here...>

Have you been able to click anywhere *else* on that table?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.