cancel
Showing results for 
Search instead for 
Did you mean: 

How to check for a row value for paginated records ?

Highlighted
Occasional Contributor

RE: How to check for a row value for paginated records ?

Sorry Jared,I do not get that by using innerText of the cell and link,they are different so can't match by looping thro' table cells.

Looks like I need to write different functions for each object type.Earlier if the # is a text it works.

' this is for the link

Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(4, 2).Table("HeaderResultsTable_DocumentNumberRN_3").Cell(0, 0).Table("HeaderResultsTable_PoNum_3_xc_").Cell(0, 2).Link("HeaderResultsTable_PoNum_3")



'This for the cell that shows the number as link

Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(4, 2)



As shown in attachment,I trying to select radio button corresponding to link of 100026,but in another form it is in text,that works fine.

InnerText when output is different for the cell and the link.

The function for looping thro' table looks like cannot be generalized across forms which have different objecttypes.

I tried find() with ObjectType as attribute and Link as value and depth as 2000.It returns last column of the table.



Please guide


Girish
Highlighted
Staff

RE: How to check for a row value for paginated records ?

Hi,



You need to use Find by object type and text. Once you find the needed link this way, you should be able to obtain the radio button which corresponds to this link (the radio button located in the same row). To do this, you just need to iterate through cells in the row where the needed text is located and find the cell in which the radio button resides. The "Parsing HTML Tables" help topic contains examples demonstrating how to iterate through table cells.
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

RE: How to check for a row value for paginated records ?

That's the approach I took.But in some of the Oracle EBS  forms,one would expect in cells the links bearing the document # on which I am basing the search, fetched using Cell(i,j).Link(0) and initiate the Click(). That's not happening,because in such cells,typically there would be 3-4 child objects before link object.

So my approach was to use the find() method for the table object to get the link,but as I said I have to loop thro' the cells of each row and get the radio button selected.Clearly in above described scenario,it is not possible. So the generalized function may not be possible





issue1.jpg reveals the output of the code which searches thro cells including below code. That's the core.looping thro' cells,Iam not able to match the #

-----Kindly go thro' comments -Find() looks weird--------

Dim iexplore

  Dim page

  Dim table

  Dim passwordBox

  Dim cell

  Dim panel

  Call TestedApps.iexplore.Run(1, True)

  Set iexplore = Sys.Process("iexplore")

  Call iexplore.ToURL("http:/XXXXXX/")

  Set page = iexplore.Page("http://XXXXX/")

 

  page.Wait

  Set table = page.Form("DefaultFormName").Panel(0).Panel(2).Table("LoginRN").Cell(1, 1).Table("region144").Cell(1, 1).Table("region14")

  table.Cell(0, 2).Table("usernameField_xc_").Cell(0, 2).Textbox("usernameField").Text = "user1"

  Set passwordBox = table.Cell(1, 2).Table("passwordField_xc_").Cell(0, 2).PasswordBox("passwordField")

  passwordBox.Text = "oracle"

  Call passwordBox.Keys("[Enter]")

  Call aqUtils.Delay(2000,"Login")

  page.Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table("topTableLayoutContainer").Cell(0, 0).Table("leftLayoutRN").Cell(1, 0).Table("region1").Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(1).Table(0).Cell(0, 0).Table(0).Cell(1, 3).Link("AppsNavLink").Click

  page.Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table("topTableLayoutContainer").Cell(0, 0).Table("leftLayoutRN").Cell(1, 0).Table("region1").Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(1).Table(0).Cell(0, 1).Table(0).Cell(2, 2).Link("N61").Click

  Call aqUtils.Delay(5000,"Login")

  Set cell = page.Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(1).Table("customizationsPoplist_xc_").Cell(0, 2)

  Call cell.Select("customizationsPoplist").ClickItem("My Open Orders")

  cell.Button(0).Click



  Set panel = page.Form("DefaultFormName").Panel(0)

   PropArray = Array("ObjectType", "Title")

  ValuesArray = Array("Link", "100064")

   '--- Find method works for table level.But doesn't for cell for this table.Even FindChild doesn't..If this works ,I can loop thro' cells and select radiobtn ---

  'set w=Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2).Find(PropArray,ValuesArray, 20000)

  'set w=Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Find(PropArray,ValuesArray, 20000)

    set w=Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2).FindChild(PropArray,ValuesArray, 20000)

   '----- End ----------------

  if w.Exists Then

 

       Log.Message("Full Name:: " +w.Fullname)

       Log.Message("Title :: "+w.Title)  ' tried Title/InnerText

      'Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2).Find(PropArray,ValuesArray,20000)

 

      Else

      Log.Message("Object does not exists")

  end if
Girish
Highlighted
Staff

RE: How to check for a row value for paginated records ?

Hi,



Find doesn't work for the cell, because you probably obtain an incorrect one. Cell indexes can change. Start searching from the page.
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

RE: How to check for a row value for paginated records ?

Thanks Jared. But my point is ,I need to loop thro' the cells and find the match,even if I am able to find starting from page.And what's I did,I believe.Pls. correct me if Iam wrong.Can you guide me with some samples ? And cell indexes what I am obtaining is correct.
Girish
Highlighted
Staff

RE: How to check for a row value for paginated records ?


Hi Girish,





Ok, in this case, please send the HTML code of the cell to the test log. Please post this HTML code here.





set aCell = Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2)

set w = aCell.FindChild(PropArray,ValuesArray, 20000)

Log.Message "Is found: " & w.Exists

Log.Message "Cell's HTML code in Remarks", aCell.outerHTML
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

RE: How to check for a row value for paginated records ?

The HTML  corresponding to this cell is :



Type    Message    Time    Link

Full Name:: Sys.Process("iexplore").Page("http:/XXXXX.com/OA_HTML/OA.jsp?page=/oracle/apps/po/document/order/webui/OrdersSummaryHeadersPG&OAHP=PO_BUYER_HOME_PAGE&OASF=PO_ORDERS_SUMMARY&language_code=US&OAFMID=83526&searchType=customize&fwkQBSearchTypeSource=/oracle/apps/po/document/order/webui/OrdersSummaryHeadersPG__HeaderQueryRN__201&_ti=1649390384&retainAM=N&addBreadCrumb=N&OAPB=PO_BRAND&oapc=7&oas=uQihBDoV6-j9uS-y1Ddkrg..").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2).Table("HeaderResultsTable_DocumentNumberRN_5").Cell(0, 0).Table("HeaderResultsTable_PoNum_5_xc_").Cell(0, 2).Link("HeaderResultsTable_PoNum_5")    12:31:24   
Girish
Highlighted

RE: How to check for a row value for paginated records ?


Hi Girish,





You have posted the full name of the object, while I asked to post the HTML code of the cell object. The HTML code of an object is stored in its 'outerHTML' property.
--
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

RE: How to check for a row value for paginated records ?

You are right Jared.I was getting the link in that cell.Here is the code I used to get cell's HTML code





<TD class="x1l x50"><TABLE id=HeaderResultsTable:DocumentNumberRN:5 cellSpacing=0 cellPadding=0 border=0>

<TBODY>

<TR id=HeaderResultsTable:DocumentNumberRow:5>

<TD id=HeaderResultsTable:DocumentNumberText:5>

<TABLE id=HeaderResultsTable:PoNum:5__xc_ cellSpacing=0 cellPadding=0 border=0>

<TBODY>

<TR>

<TD vAlign=top noWrap align=right><BR></TD>

<TD><BR></TD>

<TD vAlign=top><A class=xd id=HeaderResultsTable:PoNum:5 title=100187 href="OA.jsp?OAFunc=PO_ORDER&amp;poHeaderId=%7B!!m8E5btWDb3EYNbw.u2qnpw%7D&amp;poMode=viewOnly&amp;retainAM=Y&amp;addBreadCrumb=Y&amp;_ti=40475076&amp;oapc=8&amp;oas=cI-hwVLKv6GNU7TU1b0mrA..">100187</A>

<SCRIPT>t('5')</SCRIPT>

<IMG src="/OA_HTML/cabo/images/swan/t.gif" width=5></TD></TR></TBODY></TABLE></TD>

<TD id=HeaderResultsTable:OrderNumberPendingChanges:5>

<SCRIPT>t('13')</SCRIPT>

<IMG src="/OA_HTML/cabo/images/swan/t.gif" width=13></TD></TR></TBODY></TABLE></TD>






The  code is:.

Set panel = page.Form("DefaultFormName").Panel(0)

   PropArray = Array("ObjectType", "Title")

  ValuesArray = Array("Link", "100187") ' This is the # I 'm basing the search

  



Set aCell = Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2)

set w = aCell.FindChild(PropArray,ValuesArray, 20000)

Log.Message "Is found: " & w.Exists



Log.Message "Cell's HTML code in Remarks " & aCell.outerHTML

Log.Message "Cell's HTML code in Remarks  ", w.outerHTML



 Log.Message "Cpy from object finder :" & Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2).outerHTML



I attach this to show that somehow TC does not show up  Log.Message "Cell's HTML code in Remarks  ", w.outerHTML

[Please refer issue2.jpg]

issue3.jpg shows one of the pages i'm working on



Girish




Girish
Highlighted

RE: How to check for a row value for paginated records ?


Hi Girish,





Try using the 'innerText' property instead of the 'Title' property and let me know if this helps:

...

    PropArray = Array("ObjectType", "innerText")

    ValuesArray = Array("Link", "100187")

    

    set w=Sys.Process("iexplore").Page("*").Form("DefaultFormName").Panel(0).Panel(2).Panel(0).Panel(1).Table(1).Cell(1, 0).Panel(0).Table(0).Cell(3, 0).Table(0).Cell(0, 0).Panel(0).Panel(3).Table(0).Cell(1, 0).Table(0).Cell(6, 2)

    If Not w.Exists Then

      Log.Error "The cell object is not found"

      Runner.Stop

    End If

    w = w.FindChild(PropArray, ValuesArray, 15)

    

    if w.Exists Then

...
--
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to pass custom command-line arguments as a test parameter for the TechCorner tag!

Will you dare to take the challenge?


Top Kudoed Authors