Jump to content

Siwa

Active Members
  • Posts

    84
  • Joined

  • Last visited

About Siwa

  • Birthday 08/03/1985

Recent Profile Visitors

581 profile views

Siwa's Achievements

Wayfarer

Wayfarer (2/7)

2

Reputation

  1. Thanks, I thought so. I have another question, Is there anyway to count the number of open tabs ? I'm using portable chrome, with headless mode, my automation includes opening tabs for each process, so I want to know if the number of tabs exceed for example 10 open tabs, the browser closes and reopens the browser fresh, to avoid system resources overload.
  2. Unfortunately it did not work. here is the checkbox inspect (its located in a table): Unchecked : <tr data-ri="28" class="ui-widget-content ui-datatable-even textGreenBold" role="row" xpath="1"><td role="gridcell" style="text-align:center;width: 5% !important; padding: 1px 1px !important;"><div id="dataTable:28:j_idt248" class="ui-chkbox ui-widget"><div class="ui-helper-hidden-accessible"><input id="dataTable:28:j_idt248_input" name="dataTable:28:j_idt248_input" type="checkbox" autocomplete="off" aria-checked="false" onchange="PrimeFaces.ab({s:&quot;dataTable:28:j_idt248&quot;,e:&quot;valueChange&quot;,p:&quot;dataTable:28:j_idt248&quot;,u:&quot;formNurse&quot;,g:false});"></div><div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default"><span class="ui-chkbox-icon ui-icon ui-c ui-icon-blank"></span></div></div></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin" style="color:red;font-weight: bold;" title="جمعه">جمعه</span></td><td role="gridcell" style="text-align:center"><span class="titleBnazanin">1399/11/10</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin">2.0</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin">مصرف اصل</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin">بلی</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="no"></span></td><td role="gridcell" style="text-align:center"><span class="titleBnazanin">1399/10/29 17:21:05</span></td></tr> Checked : <tr data-ri="28" class="ui-widget-content ui-datatable-even textGreenBold" role="row" xpath="1"><td role="gridcell" style="text-align:center;width: 5% !important; padding: 1px 1px !important;"><div id="dataTable:28:j_idt248" class="ui-chkbox ui-widget"><div class="ui-helper-hidden-accessible"><input id="dataTable:28:j_idt248_input" name="dataTable:28:j_idt248_input" type="checkbox" autocomplete="off" aria-checked="false" onchange="PrimeFaces.ab({s:&quot;dataTable:28:j_idt248&quot;,e:&quot;valueChange&quot;,p:&quot;dataTable:28:j_idt248&quot;,u:&quot;formNurse&quot;,g:false});"></div><div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default ui-state-active"><span class="ui-chkbox-icon ui-icon ui-c ui-icon-check"></span></div></div></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin" style="color:red;font-weight: bold;" title="جمعه">جمعه</span></td><td role="gridcell" style="text-align:center"><span class="titleBnazanin">1399/11/10</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin">2.0</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin">مصرف اصل</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="titleBnazanin">بلی</span></td><td role="gridcell" style="text-align:center;white-space: normal;"><span class="no"></span></td><td role="gridcell" style="text-align:center"><span class="titleBnazanin">1399/10/29 17:21:05</span></td></tr> here is the element itself : Unchecked : <div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default" xpath="1"><span class="ui-chkbox-icon ui-icon ui-c ui-icon-blank"></span></div> Checked : <div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default ui-state-active" xpath="1"><span class="ui-chkbox-icon ui-icon ui-c ui-icon-check"></span></div> Here is the element with chropath : Unchecked : //tr[29]//td[1]//div[1]//div[2] Chhecked : //div[contains(@class,'ui-chkbox-box ui-widget ui-corner-all ui-state-default ui-state-active')] Sorry I forgot to write the code befor.
  3. Hi autoit community, I want to be able to check the status of a check box, to find if it is checked or unchecked, but if I try _WD_ElementAction($sSession, $element, 'Selected') no mater if the item is checked or unchecked it returns false. So far I tried Attribute Property Value with no luck. Is there any other way to find the status of the checked or unchecked box ? PS : if I use Click on the checkbox, it is clicked.
  4. That was exactly what I meant, sorry If I couldn't put my script here, it is getting bigger and bigger, and it needs an excel file to load content from. it is a smart solution, but not an appropriate one. My main goal is to solve it with the right script. But yours will do exactly what is needed. Edit : This is my solution based on your suggestion, ( changed the way I read the content to use _GUICtrlListView_GetItemText, which reads live content ) : Local $aHit = _GUICtrlListView_SubItemHitTest($hcListView) For $i=0 To UBound($aLVArray)-1 If $aHit[0] = $i And $aHit[1] = 5 Then ; item / subitem Local $Mouse_Pos = MouseGetPos() Local $LV_Pos = ControlGetPos($hMainGUI, "", $cListView) Local $GUI_Pos = WinGetPos("****") If $Mouse_Pos[0]<$GUI_Pos[0]+$LV_Pos[2] And $GUI_Pos[0]+$LV_Pos[0]<$Mouse_Pos[0] And $Mouse_Pos[1]<$GUI_Pos[1]+$LV_Pos[3] And $GUI_Pos[1]+$LV_Pos[1]<$Mouse_Pos[1] Then If _GUICtrlListView_GetItemText($hcListView, $i,5) > "" Then ToolTip(_GUICtrlListView_GetItemText($hcListView, $i,6)) Else ToolTip("") EndIf Else ToolTip("") EndIf ElseIf $aHit[0] = $i And $aHit[1] = 1 Then ToolTip("") ElseIf $aHit[0] = $i And $aHit[1] = 2 Then ToolTip("") ElseIf $aHit[0] = $i And $aHit[1] = 3 Then ToolTip("") ElseIf $aHit[0] = $i And $aHit[1] = 4 Then ToolTip("") EndIf Next
  5. I did some work on it, and I wanted to view a live view, so I added an Adlibregiser to load the data as an array ( I searched a lot to find a way to load the data of the mouse over row, when the mouse is over a specific row, but couldn't; find any), then I added this : Local $aHit = _GUICtrlListView_SubItemHitTest($hcListView) If $sP_e_Status = True Then For $i=0 To UBound($sP_e)-1 If $aHit[0] = $i And $aHit[1] = 5 Then ; item / subitem If $sP_e[$i][6] > "" Then ToolTip($sP_e[$i][6]) Else ToolTip("") EndIf ElseIf $aHit[0] = $i And $aHit[1] = 1 Then ToolTip("") ElseIf $aHit[0] = $i And $aHit[1] = 2 Then ToolTip("") ElseIf $aHit[0] = $i And $aHit[1] = 3 Then ToolTip("") ElseIf $aHit[0] = $i And $aHit[1] = 4 Then ToolTip("") EndIf Next EndIf I added a hidden 6th column, then I reload he data in a 10 sec interval, then I added this code, if there is something to be shown to the user, it is only shown when the mouse is at the 5th column. This is working well as intended, but there is a downside, my LV is in half of the GUI, and when the mouse is moved to where other 5th columns must be located, below the visible LV, where other buttons and labels are located, this code, is showing the tooltip 😅
  6. Thanks Melba, I am an absolute beginner and I can not comment on anything, but I think @pixelsearch's idea might be a way to do it. As I mentioned that I'm not very good at coding, I have been playing around for about 5 hours with no luck with WM_NOTIFY. I need to find a way to solve it by your help.
  7. Thanks, and it gave me some insight, also I managed to answer my second question, with @extended = 9 of the _GUIListViewEx_EventMonitor() . But for my first question, I want to be able to add a mouseover event, not a double click. If a mouse over is not doable, then just a single click will be more convenient for me. Is it possible to do so ?
  8. Dear Melba23, lets say I have 5 columns visible, then I want some extra information to be displayed when the mouse is on column 4, this information is related to this row and contains more details about column 4 of this row, but I don't want it to be seen unless the mouse is only at column 4. And I don't want to add a visible column to my GUI, instead I want to save the details in a separate column to be invisible to the user, but only show the contet as an tooltip when mouse is on cloumn4. And I have another question too, how can I define click event on your listview ? For example when I click on any row, lets say, a message pops up.
  9. It was an error from my coding 🙂, it actually was working. There is another problem I wan to fix, is there anyway to have a hidden column, and set the tooltip to show it ? And is it possible to only show the tooltip when the mouse is only on a single cell instead of the entire row ?
  10. I have another question, if a cell has some data in it, how can I delete the data only on a single cell ? I tried _GUIListViewEx_ChangeItem($iLV_Index, $i, 5, "") with no luck. ( Those cells update during the code ) Btw, Can I later change the background color for a previously colored cell ? Because this did not work neither. PS : I'm using _GUIListViewEx_BlockReDraw , But even after usnig __GUIListViewEx_RedrawWindow($iLV_Index) nothing was changed
  11. @CYCho Adlib will be useful if no other option is not available. I prefer to do it inside webdriver itself or the UDF. @Danp2 an example is a simple code like : $All_Cases = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='dataTable_paginator_top']/span[1]") or any other code, when the page is not loaded fully for a reason like net hiccups or sudden and momentarily net disconnecting's and the page try's to load for a long time, or is stuck at the spinning circle for ever. I want to be able to stop and repeat the process if it takes longer than 2 - 3 minutes to finish (obviously there is something going wrong), or load the page or an autoit script to proceed to the next step.
  12. Just another question, I want to add a timeout to my automation, so if the entire code is stuck at a point, then it will exit after a defined time ( like 2 minutes for example ), so the code can go on. ( My entire code checks for lots of elements and navigates to different pages) The only way I can think of is he use of TimeDiff. But if then I have to do it during each action performed, so it will be confusing and a lot of unnecessary coding. I came across _WD_Timeouts but I don't know it's function and what it does even I read the UDF part too. What are my solutions besides TimeDiff, for my entire script ? ( combination of "Page load timeout" and "Script timeout" )
  13. Thanks, but can I use a GDI+ drawing inside the listview instead ?
  14. So many thanks for your help @Nine, as this was what I was looking for, but unfortunately it is not helping me, because the image is not inserted into @Melba23's listview GUI and is placed outside of the columns. I guess I have to seek for a GDI+ replacement for my problem.
  15. I have a question, how can I add a local image (JPG) to a specific row number in a column using this UDF ? Or is there anyway to use GDI+ and add an image like the one attached ?
×
×
  • Create New...