Jump to content

Array is not matching with the second array


Recommended Posts

I have an html table that displays data along with an excel spreadsheet that has the same data as the html table. I am wanting to only match the Title column in my html table with the Title column in my Excel spreadsheet. If the titles match, click on the Edit hyperlink and continue to loop to next row. The issue I'm experience is its not matching correctly. So far  i've written the codes below:

<table border="1" class="test">
    
    <tr>
        
        <th> UniqueID</th>
        <th> Title</th>
        <th> UserID</th>
        <th> Address</th>
        <th> Gender </th>
    </tr>
    
    <tr>
        
        <td> 1 </td>
        <td> Title1 </td>
        <td> 12345 </td>
        <td> Manila </td>
        <td>
            
            <span> Male </span>
            
        </td>
    </tr>
    <tr>
        
        <td align="center" colspan="5">
           <a href="#" class="testlink">Edit</a>
        </td>
    </tr>
    <tr>
        
        <td> 2 </td>
        <td> Title2 </td>
        <td> 67891 </td>
        <td> Valenzuela </td>
        <td>
            
            <span> Female </span>
            
        </td>
    </tr>
    <tr>
        
        <td align="center" colspan="5" >
           <a href="#" class="testlink">Edit</a>
        </td>
    </tr>
    <tr>
        
        <td> 3 </td>
        <td> Title3 </td>
        <td> 88888 </td>
        <td> Ohio </td>
        <td>
            
            <span> Male </span>
            
        </td>
    </tr>
    <tr>
        
        <td align="center" colspan="5" >
           <a href="#" class="testlink">Edit</a>
        </td>
    </tr>
    <tr>
        
        <td> 4 </td>
        <td> Title4 </td>
        <td> 77777 </td>
        <td> California </td>
        <td>
            
            <span> Female </span>
            
        </td>
    </tr>
    <tr>
        
        <td align="center" colspan="5" >
           <a href="#" class="testlink">Edit</a>
        </td>
    </tr>
    <tr>
        
        <td> 5 </td>
        <td> Title5 </td>
        <td> 33333 </td>
        <td> Arizona </td>
        <td>
            
            <span> Male </span>
            
        </td>
    </tr>
    <tr>
        
        <td align="center" colspan="5" >
           <a href="#" class="testlink">Edit</a>
        </td>
    </tr>
    
</table>
#Include "Chrome.au3"

#Include "wd_core.au3"

#Include "wd_helper.au3"

#Include "Excel.au3"

#Include "_HtmlTable2Array.au3" 

#Include "Array.au3"  

Local $sDesiredCapabilities, $sSession

SetupChrome()

_WD_Startup()

$sSession = _WD_CreateSession($sDesiredCapabilities)

_WD_LoadWait($sSession)

_WD_Navigate($sSession, "index.html")

Sleep(6000)

Local $oExcel = _Excel_Open()

Local $oWorkbook = _Excel_BookOpen($oExcel, "test.xlsx")

; Get the table element
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//table[@class='test']")

; Retrieve HTML
$sHTML = _WD_ElementAction($sSession, $sElement, "Property", "outerHTML")

;Local $aTable = _HtmlTableGetWriteToArray($sHTML)

Local $aArray1 = _Excel_RangeRead($oWorkbook,1,$oWorkbook.ActiveSheet.Usedrange.Columns("B:B"))
Local $aArray2 = _HtmlTableGetWriteToArray($sHTML)

;_ArrayDisplay($aArray1)
;_ArrayDisplay($aArray2)

For $i = UBound($aArray1) - 1 To 0 step - 1
    For $j = UBound($aArray2) - 1 to 0 step - 1
        If  $aArray1[$i][1] == $aArray2[$j][1] Then
            _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//a[contains(@class,'testlink') or contains(text(),'Edit')]")
            $test1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[contains(@class,'testlink') or contains(text(),'Edit')]")
            _WD_ElementAction($sSession, $test1, 'click')
            ;_ArrayDisplay($aArray1)
           ;_ArrayDelete($aArray1 , $i)
           ;exitloop
        EndIf
    Next
Next

_WD_Shutdown()

 

Func SetupChrome()

    _WD_Option('Driver', 'chromedriver.exe')

    _WD_Option('Port', 9515)

    _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}'

EndFunc   ;==>SetupChrome

Would appreciate if anyone can provide tips, or point me in the right direction in doing it.

 

test.xlsx

Edited by Hermes
Link to post
Share on other sites

I think the problem is that double loops.  It should be a single comparing the same indice of each of the arrays.  I am supposing that both arrays have always the same dimension (in your example it is 5).  Also your loop should not be in inverse way.  And your find element should use the previous found element.

 

Link to post
Share on other sites

@NineThanks for responding! I modified the script and removed the extra for loop:

#Include "Chrome.au3"

#Include "wd_core.au3"

#Include "wd_helper.au3"

#Include "Excel.au3"

#Include "_HtmlTable2Array.au3" 

#Include "Array.au3"  

Local $sDesiredCapabilities, $sSession

SetupChrome()

_WD_Startup()

$sSession = _WD_CreateSession($sDesiredCapabilities)

_WD_LoadWait($sSession)

_WD_Navigate($sSession, "index.html")

Sleep(6000)

Local $oExcel = _Excel_Open()

Local $oWorkbook = _Excel_BookOpen($oExcel, "test.xlsx")

; Get the table element
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//table[@class='test']")

; Retrieve HTML
$sHTML = _WD_ElementAction($sSession, $sElement, "Property", "outerHTML")

;Local $aTable = _HtmlTableGetWriteToArray($sHTML)

Local $aArray1 = _Excel_RangeRead($oWorkbook,1,$oWorkbook.ActiveSheet.Usedrange.Columns("B:B"))
Local $aArray2 = _HtmlTableGetWriteToArray($sHTML)

;_ArrayDisplay($aArray1)
;_ArrayDisplay($aArray2)

For $i = 0 To UBound($aArray1) - 1
        If  $aArray1[$i][1] == $aArray2[$i][1] Then
            _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//a[contains(@class,'options-list-item') or contains(text(),'Edit')]")
            $test1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[contains(@class,'options-list-item') or contains(text(),'Edit')]")
            _WD_ElementAction($sSession, $test1, 'click')
            ;_ArrayDisplay($aArray1)
           ;_ArrayDelete($aArray1 , $i)
           ;exitloop
        EndIf
Next 

_WD_Shutdown()

 

Func SetupChrome()

    _WD_Option('Driver', 'chromedriver.exe')

    _WD_Option('Port', 9515)

    _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}'

EndFunc   ;==>SetupChrome

And now i'm getting this error message:

==> Array variable has incorrect number of subscripts or subscript dimension range exceeded

When you say "And your find element should use the previous found element.", not really sure what you mean by that.

Link to post
Share on other sites

You should read your excel sheet starting at row 2 since you have a title.

Look at _WD_FindElement there is a starting element (4th parameter), I think you will need it...

Link to post
Share on other sites

Hi @Nine I updated code below:

#Include "Chrome.au3"

#Include "wd_core.au3"

#Include "wd_helper.au3"

#Include "Excel.au3"

#Include "_HtmlTable2Array.au3" 

#Include "Array.au3"  

Local $sDesiredCapabilities, $sSession

SetupChrome()

_WD_Startup()

$sSession = _WD_CreateSession($sDesiredCapabilities)

_WD_LoadWait($sSession)

_WD_Navigate($sSession, "index.html")

Sleep(6000)

Local $oExcel = _Excel_Open()

Local $oWorkbook = _Excel_BookOpen($oExcel, "test.xlsx")

; Get the table element
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//table[@class='test']")

; Retrieve HTML
$sHTML = _WD_ElementAction($sSession, $sElement, "Property", "outerHTML")

;Local $aTable = _HtmlTableGetWriteToArray($sHTML)

Local $aArray1 = _Excel_RangeRead($oWorkbook,1,$oWorkbook.ActiveSheet.Usedrange.Columns("B:B"))
Local $aArray2 = _HtmlTableGetWriteToArray($sHTML)

;_ArrayDisplay($aArray1)
;_ArrayDisplay($aArray2)

Global $Skipline = 0 ;0==> first line

Local $temprf

For $i = 0 To UBound($aArray1, $aArray2) - 1
   If $Skipline = $i Then ContinueLoop

       $temprf &= $aArray1[$i]
        If  $aArray1[$i] == $aArray2[$i] Then
            _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//a[contains(@class,'options-list-item') or contains(text(),'Edit')]")
            $test1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "//a[contains(@class,'options-list-item') or contains(text(),'Edit')]", $aArray1[$i])
            _WD_ElementAction($sSession, $test1, 'click')
            ;_ArrayDisplay($aArray1)
           ;_ArrayDelete($aArray1 , $i)
           ;exitloop
        EndIf
Next 

_WD_Shutdown()

 

Func SetupChrome()

    _WD_Option('Driver', 'chromedriver.exe')

    _WD_Option('Port', 9515)

    _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}'

EndFunc   ;==>SetupChrome

I managed to skipped the first row, but it doesn't click the element (edit) link.

Link to post
Share on other sites

Here what your code could be if I understand you correctly :

#Include "wd_core.au3"
#Include "wd_helper.au3"
#Include <Excel.au3>
#Include <Array.au3>

Local $sDesiredCapabilities = SetupChrome()
_WD_Startup()
Local $sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "file://C:\\Applications\\AutoIt\\WebDriver\\HTML Examples\\Table.html")
_WD_LoadWait($sSession)

Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//table[@class='test']")
ConsoleWrite ("Table " & $sElement & @CRLF)
Local $aArray1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, ".//td[contains(.,'Title')]", $sElement, True)
For $i = 0 to UBound($aArray1) - 1
  $aArray1[$i] = _WD_ElementAction($sSession, $aArray1[$i], 'text')
Next
_ArrayDisplay($aArray1)
Local $aElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, ".//a[@class='testlink']", $sElement, True)
_ArrayDisplay($aElement)

Local $oExcel = _Excel_Open()
Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\test.xlsx")
Local $aArray2 = _Excel_RangeRead($oWorkbook, Default,"B2:B6")
_Excel_Close($oExcel)
_ArrayDisplay($aArray2)

; search from Excel array cells into Chrome table
Local $iIdx
For $i = 0 To UBound($aArray2) - 1
  $iIdx = _ArraySearch($aArray1, $aArray2[$i])
  If @error Then ContinueLoop
  ConsoleWrite ("Found at " & $iIdx & @CRLF)
  _WD_ElementAction($sSession, $aElement[$iIdx], 'click')
Next

;_WD_DeleteSession($sSession)
;_WD_Shutdown()

Local $aDir = _FileListToArrayRec(@TempDir, "scoped_dir*;chrome_*", $FLTAR_FOLDERS, $FLTAR_NORECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH)
Sleep(2000)
For $i = 1 To $aDir[0]
  DirRemove($aDir[$i], $DIR_REMOVE)
Next

Func SetupChrome()
    _WD_Option('Driver', 'chromedriver.exe')
    _WD_Option('Port', 9515)
    _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')
    Return '{"capabilities":{"alwaysMatch":{"goog:chromeOptions":{"w3c":true,' & _
    '"excludeSwitches":["enable-automation"],"useAutomationExtension":false}}}}'
EndFunc   ;==>SetupChrome

 

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mLipok
      wd_capabilities.au3 UDF was changed/modified/refactored .... and commited/merged (02-12-2021) to https://github.com/Danp2/WebDriver

      WARNING: Before you start using this UDF be sure you download the recent version from: https://github.com/Danp2/WebDriver
       
      ==================================================================================================

      Recently I start wd_capabilities.au3 project on my side.
      I think this is time to share to AutoIt community.
      Check attached UDF: wd_capabilities.au3

      Here is a scratch example showing how to use them:
      #include "wd_helper.au3" #include "wd_capabilities.au3" _Example() Func _Example() ........ ........ ........ _WD_Capabilities_Build_Arguments(Null) ; CLEANUP ARGS _WD_Capabilities_Build_Arguments('--headless') _WD_Capabilities_Build_Arguments('start-maximized') _WD_Capabilities_Build_Arguments('disable-infobars') _WD_Capabilities_Build_Arguments('user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default') Local $s_WD_Capabilities_Arguments = _WD_Capabilities_Build_Arguments(Default) ; GET ARGS _WD_Capabilities_Build_Preferences(Null) ; CLEANUP PREFS If $s_Download_dir Then _WD_Capabilities_Build_Preferences('download.default_directory', $s_Download_dir) Local $s_WD_Capabilities_Preferences = _WD_Capabilities_Build_Preferences(Default) ; GET PREFS Local $s_Desired_Capabilities = _WD_Capabilities_Build_JSON('chrome', $s_WD_Capabilities_Arguments, $s_WD_Capabilities_Preferences) Local $WD_SESSION = _WD_CreateSession($s_Desired_Capabilities) ........ ........ ........ EndFunc  
      I plan to publish the code on GitHub.
      In the indefinite future, when the project becomes more functional, if @Danp2 accepts it, I hope it may be included in the main WebDriver UDF.

      I am waiting for yours feedback and help in the further development of this project.

      REMARK 1:
      As so far this UDF only supports GoogleChrome.
      Adding support for other browsers shouldn't be difficult, I just didn't need to.

      REMARK 2:
      For now, this project is working but still as a early BETA, so please do not discuss, ask questions, or post examples or snippets of code that pertain to any function of this UDF in other part of this forum, until it is found acceptable. Simply: discusion and tests only here in this topic.


      Regards,
      @mLipok
       
    • By Rskm
      Hi, I have 5 notepad files with lot of data in each of it. The data are arranged in lines and i wish to get it pasted/copied into excel.  Say, i need to read notepad1 and paste the contents into sheet1 of excel and notepad2 to sheet2 and so on.  If i read the notepad and paste it line by line, it is taking lot of time.  Is there a way by which i can paste the whole of notepad file into excel sheet(and get it pasted line by line as shown in the attached excel), instead of using code to write it line by line?.. I was using Filewriteline(data, line i) initially to write to excel.  The 'i' value was incremented with for loop and the excel was updated, but this takes lot of time.  The expected excel format is attached here.  any help is appreciated.  thanks
      Tmp.xls
    • By Hermes
      Hi, I am trying to select elements in print page (dialog window) for a specific web page. But when trying to do so, it looks like it does not allow me to do it.
      So far, this is what I have:
      _WD_WaitElement($sSession, $_WD_LOCATOR_ByCSSSelector, "body") Local $mainpagebody = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "body") _WD_HighlightElement($sSession, $mainpagebody, 2) _WD_WaitElement($sSession, $_WD_LOCATOR_ByCSSSelector, "img.print-button") Local $printbutton = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "img.print-button") _WD_ElementAction($sSession, $printbutton, 'click') _WD_LoadWait($sSession) Sleep(3000) _WD_WaitElement($sSession, $_WD_LOCATOR_ByCSSSelector, "body") Local $printpagebody = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "body") _WD_HighlightElement($sSession, $printpagebody, 2) The script above highlights the main web page "body" element, then clicks a tag to print a specific part of the page, then it will open a print page window where i am trying to highlight the body of that print page - but it looks like it is dropping from the session because it opens up another chrome page chrome://print.
       
      Below is the output log:
      __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/element; $sData={"using":"css selector","value":"body"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}} _WD_WaitElement ==> Success __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/element; $sData={"using":"css selector","value":"body"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/execute/sync; $sData={"script":"arguments[0].style='background: #FFFF66; border-radius: 5px; padding-left: 3px;'; return true;", "args":[{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}]} __WD_Post: StatusCode=200; ResponseText={"value":true}... _WD_ExecuteScript: {"value":true}... __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/element; $sData={"using":"css selector","value":"img.print-link"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"eb9e4673-4dec-4d4c-be6a-b7967743394b"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"eb9e4673-4dec-4d4c-be6a-b7967743394b"}} _WD_WaitElement ==> Success __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/element; $sData={"using":"css selector","value":"img.print-link"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"eb9e4673-4dec-4d4c-be6a-b7967743394b"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"eb9e4673-4dec-4d4c-be6a-b7967743394b"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/element/eb9e4673-4dec-4d4c-be6a-b7967743394b/click; $sData={"id":"eb9e4673-4dec-4d4c-be6a-b7967743394b"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_ElementAction: {"value":null}... __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/execute/sync; $sData={"script":"arguments[0].style='background: #FFFF66; border-radius: 5px; padding-left: 3px;'; return true;", "args":[{"element-6066-11e4-a52e-4f735466cecf":"eb9e4673-4dec-4d4c-be6a-b7967743394b"}]} __WD_Post: StatusCode=200; ResponseText={"value":true}... _WD_ExecuteScript: {"value":true}... __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/execute/sync; $sData={"script":"return document.readyState", "args":[]} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"script timeout","message":"script timeout\n (Session info: chrome=92.0.4515.107)... __WD_Post ==> Webdriver Exception: {"value":{"error":"script timeout","message":"script timeout\n (Session info: chrome=92.0.4515.107)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C63733+2504499]\n\tOrdinal0 [0x00BFC401+2081793]\n\tOrdinal0 [0x00B024F0+1058032]\n\tOrdinal0 [0x00B55685+1398405]\n\tOrdinal0 [0x00B45E83+1334915]\n\tOrdinal0 [0x00B54CDB+1395931]\n\tOrdinal0 [0x00B45D4B+1334603]\n\tOrdinal0 [0x00B222B4+1188532]\n\tOrdinal0 [0x00B23149+1192265]\n\tGetHandleVerifier [0x00DDFB8C+1512252]\n\tGetHandleVerifier [0x00E8B0DF+2214031]\n\tGetHandleVerifier [0x00CE4BC3+484211]\n\tGetHandleVerifier [0x00CE3E69+480793]\n\tOrdinal0 [0x00C0218D+2105741]\n\tOrdinal0 [0x00C066E8+2123496]\n\tOrdinal0 [0x00C06827+2123815]\n\tOrdinal0 [0x00C0FB73+2161523]\n\tBaseThreadInitThunk [0x75EB62C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x77C11B69+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x77C11B34+1028]\n"}} _WD_ExecuteScript: {"value":{"error":"script timeout","message":"script timeout\n (Session info: chrome=92.0.4515.107)... _WD_ExecuteScript ==> Webdriver Exception: HTTP status = 500 _WD_LoadWait ==> Webdriver Exception __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/element; $sData={"using":"css selector","value":"body"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}} _WD_WaitElement ==> Success __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/element; $sData={"using":"css selector","value":"body"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/cd08704233a965ccbaf9292e8692c3e4/execute/sync; $sData={"script":"arguments[0].style='background: #FFFF66; border-radius: 5px; padding-left: 3px;'; return true;", "args":[{"element-6066-11e4-a52e-4f735466cecf":"91a394f0-004c-480d-aedf-52e2b30233c6"}]} __WD_Post: StatusCode=200; ResponseText={"value":true}... _WD_ExecuteScript: {"value":true}...  
      Is it even possible to select elements in print page?

    • By Danp2
      Introduction
      This UDF will allow you to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a few configuration settings.
      Requirements
      JSON UDF https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn
      WinHTTP UDF https://www.autoitscript.com/forum/topic/84133-winhttp-functions/
      HtmlTable2Array UDF (optional) https://www.autoitscript.com/forum/topic/167679-read-data-from-html-tables-from-raw-html-source/
      WebDriver for desired browser
      Chrome WebDriver https://sites.google.com/a/chromium.org/chromedriver/downloads FireFox WebDriver https://github.com/mozilla/geckodriver/releases Edge WebDriver https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Source Code
      You will always be able to find the latest version in the GitHub Repo 
      Help / Support
      See the wiki for details on the UDF --
      https://www.autoitscript.com/wiki/WebDriver
      Please post any questions, suggestions or errors in the GH&S thread.
      https://www.autoitscript.com/forum/topic/205553-webdriver-udf-help-support-iii/
      Previous support threads (Closed)
      https://www.autoitscript.com/forum/topic/192730-webdriver-udf-help-support/
      https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/
       
    • By EmilyLove
      I have a string containing the full path of an executable and an array of executables without their paths. I am trying to compare the string to the list in the array and if a match is found, remove it from the array. The entry get removed from the array successfully, and after checking its return result, uses it to update the ubound if it succeeded, but it doesn't want to update to the new value. Any ideas what I am doing wrong? It acts like it is read-only.
      #include <Array.au3> #include <File.au3> Local $sApp_Exe = "F:\App\Nextcloud\nextcloud.exe" Local $aWaitForEXEX = [3, "Nextcloud.exe", "nextcloudcmd.exe", "QtWebEngineProcess.exe"] For $h = 1 To $aWaitForEXEX[0] If StringInStr($sApp_Exe, $aWaitForEXEX[$h]) <> 0 Then $iRet = _ArrayDelete($aWaitForEXEX, $h) If $iRet <> -1 Then $aWaitForEXEX[0] = $iRet ;this line doesn't work. $aWaitForEXEX[0] doesn't update and shortly gives Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.: _ArrayDisplay($aWaitForEXEX) EndIf Next  
×
×
  • Create New...