Jump to content

array read and process through it


Recommended Posts

Sometimes it needs two pairs of eyes :whistle:

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I get this output while running this part of the code "_open("http://www.google.com")" - any hints?

COM Error

Number: 0x000000A9

ScriptLine: 5166

WinDescription:

Description: Variable must be of type 'Object'.

Source:

COM Error

Number: 0x000000A9

ScriptLine: 5172

WinDescription:

Description: Variable must be of type 'Object'.

Source:

COM Error

Number: 0x000000A9

ScriptLine: 5177

WinDescription:

Description: Variable must be of type 'Object'.

Source:

Link to comment
Share on other sites

Don't see function _open in your code. Is it in some of your includes?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Without seeing the code it's not easy to help.

It looks like you try to work with an object variable which doesn't point to an object.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

got this working opening a hard coded url but will make it all data driven now.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#AutoIt3Wrapper_Outfile=C:\laptop apps\BlueDuck SDA 2.0\examples\readexcelnyworksheetname.a3x
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <../lib/sda.core.au3>
#include <Excel.au3>
#include <Array.au3>
Global $aSheetData
Global $sBrowser
Global $iIndex
$sBrowser = "iehta"
Global $oExcel
Global $aSheets
Global $sSheet2Process
Global $oTest
$oExcel = _ExcelBookOpen("E:\datafiles\DOT\JLauto\Resources\DOT.xls")
If @error Then Exit MsgBox(16, "Error", "_ExcelBookOpen returned error " & @error)
$aSheets = _ExcelSheetList($oExcel)
If @error Then Exit MsgBox(16, "Error", "_ExcelSheetList returned error " & @error)
While 1
    $sSheet2Process = InputBox("Prompt", "Please enter the name of the sheet to process", "")
    If @error = 1 Then ExitLoop ; Cancel was pressed
    _ExcelSheetActivate($oExcel, $sSheet2Process) ; Activate the sheet
    If @error Then
        MsgBox(16, "Error", "_ExcelSheetActivate returned error " & @error)
    Else
        $aSheetData = _ExcelReadSheetToArray($oExcel) ; Read the whole sheet into an array
        If @error Then
            MsgBox(16, "Error", "_ExcelSheetActivate returned error " & @error)
        Else
            _ProcessSheet($aSheetData)
        EndIf
    EndIf
WEnd
Func _ProcessSheet(ByRef $aSheetData)
    ; Process the data in the active sheet
    For $iRow = 3 To $aSheetData[0][0]
        For $iCol = 3 To $aSheetData[0][1] - 1
            If $aSheetData[$iRow][$iCol] = "" then
   MsgBox(16, "nothing to process", $aSheetData[$iRow][$iCol],2)
   else
   ;MsgBox(0, "found something to process",  $aSheetData[$iRow][$iCol],2)
   if StringInStr($aSheetData[$iRow][$iCol], "LaunchApp|") > 0 then
    msgbox(0,"Found a url to open",$aSheetData[$iRow][$iCol],2)
    Local $oTest,$oRepo
    ;New Test object
    $oTest = NewTest(@ScriptName)
    ;Start Test
    ;$oTest.Setup()
    ;Test Report create
    $oTest.Report.Create
    ;New Browser
    $oTest.NewBrowser($sBrowser,'http://es.altavista.com')
    $oTest.Browser.start
    ;Search in Altavista
    _open("/'")
    _windowMaximize()
    _waitForPageToLoad("3000")
    _type("//*[@id='yschsp']","BlueDuck SDA")
    _click("//*[@id='yschbt']")
    _waitForPageToLoad("3000")
    ;Check and add Steps Results
    If _isTextPresent("AutoIt driver for Selenium ") = 1 Then
     $oTest.AddStepResult("Step 1","Search",1)
    Else
     $oTest.AddStepResult("Step 2","Search",0)
    EndIf
    $oTest.Report.Close
    $oTest.Browser.stop
    endif
   EndIf
        Next
    Next
EndFunc   ;==>_ProcessSheet

Func setUp()
  $oTest.NewBrowser('firefox','http://www.google.com/')
  $oTest.Browser.start
        _createReport(@ScriptName) ;Set the result report
        _construct($sBrowser ,"http://www.google.com/")
        _start()
EndFunc
Func tearDown()
        ;_reportClose()
        _stop()
EndFunc
_ExcelBookClose($oExcel)
Link to comment
Share on other sites

All problems solved now?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 4 weeks later...
:D

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...