Contributions
Re: TestComplete not responding
Hi Vijay, Create a event handler function for the event OnLogError. something like For process_count = 0 To Sys.ChildCount - 1 process_count = 0 .ChildCount - 1 Set p = Sys.Child(process_count) if p.ProcessName ="iexplore" then Log.Message(" IE instance : " &process_count & " :: " & p.ProcessName) Call aqUtils.Delay(2000,"Delay for closing : " & p.ProcessName) p.Close end if ' If there are other processes which brings up windows or dialogs, pls. do the same as above Next Similarly for UnexpectedWindow also create a event handler to handle the unexpected window like Sub GeneralEvents_OnUnexpectedWindow(Sender, Window, LogParams) if LogParams.str="Unexpected window" then Log.Message(" Full name of the unexpected window : " &Window.FullName) Window.Close() else Log.Message(" Full name of the unexpected window : " &Window.FullName) Sys.Process("iexplore").Window("#32770", "Windows Internet Explorer", 1).Close() end if HTH Girish2.3KViews0likes0CommentsRe: Maximize browser window
Just to add what Mike stated. Better to find the BrowserIndex of the browser instance used and use that. In VBscript though, some thing like this.. Set wScriptObj = Sys.OleObject("WScript.Shell")Call wScriptObj.Run("iexplore.exe " & ProjectSuite.Variables.URL) wScriptObj = .OleObject("WScript.Shell") wScriptObj.Run("iexplore.exe " & .Variables.URL) Set browser=Sys.Browser("iexplore") Set page = browser.Page(ProjectSuite.Variables.Page) index=browser.BrowserIndex browser.BrowserWindow(index).Maximize5.1KViews0likes0CommentsRe: Swing windows is not identifying in java application.
Same issue is happening with me. it just says 'Waiting for Swing object",even if I give a liberal delay of 30 sec. It gets the Java process, like Sys.Process("Java") and then tries togets the the Swing object. It's an endless wait. I need to stop it after some waiting time. I'm not sure whether WaitProperty would work,because Java Object,I'm able to get.This happens only 1 in 5/6 times.So how to abort the script run in such cases ?1.1KViews0likes0CommentsRe: How to check for a row value for paginated records ?
Correct David. My goal is to write a function which can be used across pages which render tabular data to find a status /perform an action based on the value passed.Hindrance in my method is that compare doesn't work and in your code , rowIndex = linkObj.Parent.Parent.Parent.Parent.Parent.RowIndex, doesn't that inject dependency where in one would need to know the hierarchy in advance ? Would I be able to write a function to achieve that ?I guess that also depends on the framework used to render the objects ? Could you point me in the right direction ?2.4KViews0likes0Comments- 2.4KViews0likes0Comments
Re: How to check for a row value for paginated records ?
Thanks David ! You are right,I indeed did that earlier. As I said earlier we have screens which have paginated records and we need to test whether it performs some operation(it could be clicking on a rdb/link or even status check),so I am trying to create a function which will loop thro' the rows and cells based on inputs ; they are parent object(i used the higher level object),text to search and possibly the type of object. As a sample I tried to use i/p params as object and matchtext.Surprisingly innerText is not able to match and function returns false,I also tried Title. Reason is I think is evident from attached issue7.jpg.SO which property should I use to match ? --------------------------------------------------------------------------------- sub PO35 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:/XXXX.org:8006/") Set page = iexplore.Page("http://XXXX.org:8006/") 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 = "test" 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", "100187") if 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).RowCount>1 Then set o=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).Find(PropArray,ValuesArray, 20000) Log.Message(o.ObjectType) ' I 'm able to identify the type set pg=GetPage() pg.Wait 'Get table set tbl=pg.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) check= LoopCells(tbl,"100187") ' Function Log.Message(check) end if end sub Function GetPage() Set p = Sys.Process("iexplore") Set GetPage =p.Page("*") End Function Function LoopCells(tableobj,matchtext) if tableobj.exists Then Log.Message("tableobj exists ") 'log.Message(tableobj.Cell(1, 2).innerText) Else exit function end if For i = 1 To tableobj.RowCount-1 For j = 0 To tableobj.ColumnCount(i)-1 Set Cell = tableobj.Cell(i, j) 'Log.Message(Cell.ObjectType) 'Returns Null . if j=2 then 'Log.Message ("Cell " & j & ": " & Cell.innerText & " row :" & i) Log.Message(Cell.ObjectType) Log.Message ("Cell " & j & ": " & Cell.innerText & " row :" & i) end if if (Cell.innerText=matchtext) Then Result = CBool(1 + 1 = 2) LoopCells=Result exit function else Result = CBool(1 + 1 = 5) LoopCells=Result end if Next Next End Function2.4KViews0likes0CommentsRe: How to check for a row value for paginated records ?
Good Morning David ! I had this already tried out.Please see the screenshot which shows that object doesn't exist,that's surprising.in help topics also,innerText is recommended. That's easy to see because following code 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=888743756&retainAM=N&addBreadCrumb=N&OAPB=PO_BRAND&oapc=7&oas=gotAlpy2tTZu4kSu_ZWNuw..").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(7, 2).innerText in object finder is shown in issue4.jpg and issue5.jpg reveals why it is ,I believe. issue6.jpg clearly shows that within the cell ,it has other objects like table and not just the link object that's contained. Important point i believe is that only for link I see this for some of the forms others its just that object in the cell,which makes it difficult to write a function for all forms to perform an operation like clicling a link/selection of radiobtn based on the number(typically invoice/PO) displayed in a row. So any alternative solution ?2.4KViews0likes0CommentsRe: 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&poHeaderId=%7B!!m8E5btWDb3EYNbw.u2qnpw%7D&poMode=viewOnly&retainAM=Y&addBreadCrumb=Y&_ti=40475076&oapc=8&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 Girish3KViews0likes0Comments