Jump to content

Help with ultrawebgrid


MShah
 Share

Recommended Posts

Hi Everyone

I am writing a script to check if our website is up and running and the requirement is to login and select an option from an ultrawebgrid, I can select a row using mouse movements and mouse click, but when i try to do it by using _IEACTION($oRow, "click") it does not work and logs off.

I have gone through a few topics and have found out that I should be using fireEvent as the ultrawebgrid has a few events associated.

I have tried using fireEvent and that does not do anything either

I am attaching the html code for ultrawebgrid. Any help in this matter would be appreciated.

Code Pasted

************************

<TABLE onmouseup='igtbl_cellClickUp(event,"ctl00xcphMasterxUltraWebGrid1");' oncontextmenu='igtbl_cellContextMenu(event,"ctl00xcphMasterxUltraWebGrid1");' onmousemove='igtbl_cellMouseMove(event,"ctl00xcphMasterxUltraWebGrid1");' onselectstart='igtbl_selectStart(event,"ctl00xcphMasterxUltraWebGrid1");' onmousedown='igtbl_cellClickDown(event,"ctl00xcphMasterxUltraWebGrid1");' id="G_ctl00xcphMasterxUltraWebGrid1" ondblclick='igtbl_cellDblClick(event,"ctl00xcphMasterxUltraWebGrid1");' onmouseover='igtbl_cellMouseOver(event,"ctl00xcphMasterxUltraWebGrid1");' style="TABLE-LAYOUT: fixed; WIDTH: 895px; POSITION: relative" onmouseout='igtbl_cellMouseOut(event,"ctl00xcphMasterxUltraWebGrid1");' cellSpacing="0" cellPadding="0" border="0" bandNo="0" StationaryMarginsOutlookGroupBy="True"><COLGROUP><COL width="70" /><COL width="280" />

<THEAD onmouseup='igtbl_headerClickUp(event,"ctl00xcphMasterxUltraWebGrid1");' oncontextmenu='igtbl_headerContextMenu(event,"ctl00xcphMasterxUltraWebGrid1");' onmousemove='igtbl_headerMouseMove(event,"ctl00xcphMasterxUltraWebGrid1");' onmousedown='igtbl_headerClickDown(event,"ctl00xcphMasterxUltraWebGrid1");' onmouseover='igtbl_headerMouseOver(event,"ctl00xcphMasterxUltraWebGrid1");' style="DISPLAY: none" onmouseout='igtbl_headerMouseOut(event,"ctl00xcphMasterxUltraWebGrid1");'>

<TR>

<TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_0" style="DISPLAY: none" width="100" height="20" columnNo="0">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_1" width="70" height="20" columnNo="1" charApnd="1">&nbsp;&nbsp;<IMG height="0" alt="Sorted ascending" src="this has been edited" width="0" border="0" imgType="sort" igAltD="Sorted descending" /></TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_2" width="280" height="20" columnNo="2">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_3" width="140" height="20" columnNo="3">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_4" style="TEXT-ALIGN: center" width="40" height="20" columnNo="4">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_5" style="TEXT-ALIGN: center" width="60" height="20" columnNo="5">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_6" style="TEXT-ALIGN: center" width="60" height="20" columnNo="6">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_7" width="70" height="20" columnNo="7">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_8" width="70" height="20" columnNo="8">&nbsp;</TH><TH class="ctl00xcphMasterxUltraWebGrid1-hc" id="ctl00xcphMasterxUltraWebGrid1_c_0_9" width="60" height="20" columnNo="9">&nbsp;</TH></TR></THEAD><TBODY>

<TR id="ctl00xcphMasterxUltraWebGrid1_r_13" style="HEIGHT: 20px" level="13" DataKey="cf2ffc83-5c5a-4002-bab3-933bda0c1f83">

<TD class="ctl00xcphMasterxUltraWebGrid1-0-ic" id="ctl00xcphMasterxUltraWebGrid1_rc_13_0" style="DISPLAY: none" oldborderTopStyle="none" oldborderTopColor="window" oldborderTopWidth="1px" oldborderBottomStyle="none" oldborderBottomColor="silver" oldborderBottomWidth="1px"><NOBR>cf2ffc83-5c5a-4002-bab3-933bda0c1f83</NOBR></TD>

<TD class="ctl00xcphMasterxUltraWebGrid1-0-ic" id="ctl00xcphMasterxUltraWebGrid1_rc_13_1" unselectable="on" oldborderLeftStyle="solid" oldborderLeftColor="window" oldborderLeftWidth="0px" oldborderTopStyle="solid" oldborderTopColor="window" oldborderTopWidth="1px" oldborderBottomStyle="solid" oldborderBottomColor="silver" oldborderBottomWidth="1px"><NOBR>ZI</NOBR></TD>

<TD class="ctl00xcphMasterxUltraWebGrid1-0-ic" id="ctl00xcphMasterxUltraWebGrid1_rc_13_2" oldborderTopStyle="solid" oldborderTopColor="window" oldborderTopWidth="1px" oldborderBottomStyle="solid" oldborderBottomColor="silver" oldborderBottomWidth="1px"><NOBR>ITALIAN MOSAIC</NOBR></TD>

Link to comment
Share on other sites

This is the function in autoit

Func Select_tour ()

$oFileInfo = $oFileInfo & @CRLF & "Func Pick_Tour()" & @CRLF

$oFileInfo = $oFileInfo & "=======================================" & @CRLF

If _IEPropertyGet ($oIE, "locationurl") = $locationurl3 And _IEPropertyGet ($oIE, "locationname") = $locationname4 Then

WinActivate($ohandle, "")

;WinMove ($ohandle[$i], "",0+20*$i , 0+20*$i, 500, 900)

$otest = _IEGetObjByName($oIE, "ctl00xcphMasterxUltraWebGrid1")

$orow1 = _IEGetObjByName($otest, "ctl00xcphMasterxUltraWebGrid1_r_6")

$orow1.selected = True

;$orow1.fireEvent("rowSelectorClick(" & $otest & "," & $orow1 & ")")

MsgBox(1,"test", @error)

$oTable = _IETableGetCollection($oIE, 15)

$oRow = _IETagNameGetCollection($oTable, "TR", 2)

$colTD = _IETagNameGetCollection($oRow, "TD")

$TD_Cnt = @extended

;$oTD5 = _IEGetObjByID($oIE, "ctl00xcphMasterxUltraWebGrid2_rc_1_1")

If $TD_Cnt Then

$i = 0

For $oTD In $colTD

if $oTD.InnerText = "ZIW" Then

$oTD.fireEvent("cellclick")

MsgBox(1,"test", @error)

;MsgBox(1,"test1","Width: " & _IEPropertyGet($oTable,"uniqueid"))

EndIf

$i += 1

Next

EndIf

;********* This portion works fine ****

;MouseMove(500*$i, 800*$i, 0)

;MouseClick("left")

_IELoadWait ($oIE, 0, 10000)

$oFileInfo = $oFileInfo & "Success - Opened Page " & $locationurl3 & @CRLF

Else

$oErrorMsgFlag = True

$oErrorMsg = $oErrorMsg & "Event occurred when accessing page " & @CRLF & $locationurl3 & @CRLF & "Page Name: " & $locationname4 & @CRLF

$oFileInfo = $oFileInfo & "Failed - Opened Page " & $locationurl3 & @CRLF

EndIf

EndFunc

I have been trying different options to make it work

Link to comment
Share on other sites

It may not be the row that needs to be clicked on, but another object.

You may want to get the coordinates of the object you want to click on with _IEPropertyGet and then use MouseMove and MouseClick.

When you use fireEvent, you must tell it what event you want to fire (it may take more than one) - for example: $oTD.fireEvent("onclick")

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks for your reply Dale

I have allready been using mouse click bu would like to know if I can use a _IEAction or fireEvent to select a row as this code would be used on different screen resolutions and might not work on some of them with a mouse click.

Help on this code would be much appreciated

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...