Jump to content

WebDriver UDF - Help & Support


Recommended Posts

@Danp2 Here is an exemple that reproduce exactly my issue. Or my knowledge missing. 

If you can help me. to make this click work it will help me to make it work on my pro website.  and obviusly learn me how to face this.

_StartupWD ()
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.2
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

;Firefox
;Si pas de numéro de dossier

; Script Start - Add your code below here
#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <String.au3>
;~ #include "C:\include\Chrome.au3"
#include "Chrome.au3"
#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <Clipboard.au3>
;~ #include "C:\include\Restart.au3"
#include "Restart.au3"
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
;~ #include <C:\include\webdrivers\WD_core.au3>
#include <WD_core.au3>
;~ #include <C:\include\webdrivers\WD_helper.au3>
#include <WD_helper.au3>
;~ #include <C:\include\webdrivers\WinHTTP.au3>
#include <WinHTTP.au3>
;~ #include <C:\include\webdrivers\Json.au3>
#include <Json.au3>




Opt("WinTitleMatchMode", 2)
$IniLocation = @ScriptDir & "\Ini.ini"


Global $cDepartment = "" , $cType = "" , $cNumeroDossier = "" , $cNom = "" , $cEmail = "" , $cTel = "" , $cPattern = "" , $nString = 0 , $StartingPoint = 0

Global $cArrayResults , $cString , $sSession , $sElement , $sElement0 , $sElement00 , $sElement000000 , $sElement000 , $sElement2 , $sElement3 , $sElement4 , $sElement5 , $sElement6 , $sElement7 , $sElement8 , $sElement9

Global Const $cService = "!Service Numérique"

;Suppression du fichier texte pour partir sur une base propre.

Local Enum $eFireFox = 0, _
            $eChrome

Local Const $_TestType = $eChrome
Local $sDesiredCapabilities
Local $sText
Local $sSession

$_WD_DEBUG = $_WD_DEBUG_None

$IniLocation = @ScriptDir & "\Ini.ini"

;Configuration des hotkeys
HotKeySet("{F2}", "_Main")
HotKeySet("{F4}", "_Seconde")
HotKeySet("{ESCAPE}", "_Exit")

_StartupWD ()

While 1
    Sleep (100)
    $msg = GUIGetMsg ()
      Switch $msg
         Case $GUI_EVENT_CLOSE
            _WD_DeleteSession($sSession)
            _WD_Shutdown()
            WinClose("chromedriver.exe")
            Exit
      EndSwitch
WEnd

Func _Main ()
    $nString = _CaraClipboard2 ()
    $nString = _RegExp ($nString)
    If IsArray($nString) Then
          _DefinitionVar ()
    EndIf
    _FindAllElements ()
    _EnvoiEnWD ()
    _OuvrirDossier ()
    _ChercherDossier ()
    _CleanUp ()
EndFunc

Func _Seconde ()
    _WD_WaitElementpPGDN ($sSession, $_WD_LOCATOR_ByXPath, "//button[@title='Transfert [Alt+Shift+T]']" , "", 15000)
    $sElementXY = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@title='Transfert [Alt+Shift+T]']") ; Transfert
    _WD_ElementAction($sSession, $sElementXY, 'click' )
;~  $xt=271
;~  $xl=169
;~  $xb=1017
;~  $xr=602
;~  $xtm = $xt
;~  $xlm = $xl
;~  $pixel = ""
;~  $cExitLoopVar = 0
;~  Do
;~      $xtm += 15
;~      $xlm += 15
;~      $pixel = PixelSearch($xt,$xl , $xb,$xr , 0xCD1104 )
;~      MouseMove ( $xtm, $xlm )
;~      If IsArray ($pixel) Then $cExitLoopVar = 1
;~  Until $cExitLoopVar = 1
;~  MouseClick ("left" , $pixel[0]+30,$pixel[1] , 1 , 0 )
Sleep (5000)
    $sElementXY = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@class='form_input_undefined']") ; Transfert
    $sAction = '{"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":661,"y":289,"type":"pointerMove","origin":{"ELEMENT":"'
    $sAction &= $sElementXY & '","' & $_WD_ELEMENT_ID & '":"' & $sElementXY & '"}},{"button":2,"type":"pointerDown"},{"button":2,"type":"pointerUp"}]}]}'
    ConsoleWrite("$sAction = " & $sAction & @CRLF)
    _WD_Action($sSession, "actions", $sAction)
EndFunc

Func _CaraClipboard ()

EndFunc

Func _CaraClipboard2 ()

EndFunc

Func _RegExp ($cString)

EndFunc

Func _DefinitionVar ()

EndFunc

Func _OuvrirDossier ()

EndFunc

Func _ChercherDossier ()

EndFunc


Func _EnvoiEnWD ()

EndFunc

Func _CleanUp ()

EndFunc

Func _LoginClavis ()

EndFunc

Func _Exit ()
      $cExitYesNo = MsgBox ($MB_YESNO , "Quitter?" , "Voulez-vous quitter ?")
      If $cExitYesNo = "6" Then
            _WD_DeleteSession($sSession)
            _WD_Shutdown()
            WinClose("chromedriver.exe")
            Exit
      EndIf
EndFunc

Func _FindAllElements ()

EndFunc

Func _SendInAllElement ()

EndFunc

Func _StartupWD ()
    SetupChrome()
    _WD_Startup();Demarrage du WebDriver
    $sSession = _WD_CreateSession($sDesiredCapabilities);Option du browser
    _WD_NewTab($sSession);nouvel onglet
    _WD_Navigate($sSession, "https://plugins.jquery.com/")
    $sElement00001 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@href='https://js.foundation/CLA']") ; mail jet account
    _WD_ElementAction($sSession, $sElement00001 , 'click')
EndFunc
;~ <a href="https://js.foundation/CLA">CLA</a>
Func SetupChrome()
   _WD_Option('Driver', 'chromedriver.exe')
   _WD_Option('Port', 9515)
   _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')
   $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true }}}}'
EndFunc

Func _WD_WaitElementpPGDN($sSession, $sStrategy, $sSelector, $iDelay = 0, $iTimeout = -1, $lVisible = False)
    Local Const $sFuncName = "_WD_WaitElement"
    Local $bAbort = False, $iErr, $iResult = 0, $sElement, $lIsVisible = True

    If $iTimeout = -1 Then $iTimeout = $_WD_DefaultTimeout

    Sleep($iDelay)

    Local $hWaitTimer = TimerInit()

    While 1
        Send("{PGDN}")
        $sElement = _WD_FindElement($sSession, $sStrategy, $sSelector)
        $iErr = @error

        If $iErr = $_WD_ERROR_Success Then
            If $lVisible Then
                $lIsVisible = _WD_ElementAction($sSession, $sElement, 'displayed')
            EndIf

            If $lIsVisible = True Then
                $iResult = 1
                ExitLoop
            EndIf

        ElseIf $iErr <> $_WD_ERROR_NoMatch Then
            ExitLoop
        EndIf

        If (TimerDiff($hWaitTimer) > $iTimeout) Then
            $iErr = $_WD_ERROR_Timeout
            ExitLoop
        EndIf

        Sleep(1000)
    WEnd

    Return SetError(__WD_Error($sFuncName, $iErr), 0, $iResult)
EndFunc

Oh i forgot : 

To help you to help me ; 

image.png.40f808dc410f48af8bc73d8ee7d7b63c.png

So this is the exact case i am facing : 

I have to move over Contribut to click on CLA 

And with webDriver only So my mouse if free to work on an other task

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

You have to hover over the dropdown element to trigger it to show the menu. Then you can click on the desired element.

_WD_Navigate($sSession, "https://plugins.jquery.com/")
    $sElement00001 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//li[@class='dropdown']")

    $sAction = '{"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"'
    $sAction &= $sElement00001 & '","' & $_WD_ELEMENT_ID & '":"' & $sElement00001 & '"}}]}]}'

    _WD_Action($sSession, "actions", $sAction)
    _WD_Action($sSession, "actions")

    $sElement00001 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@href='https://js.foundation/CLA']")
    _WD_ElementAction($sSession, $sElement00001 , 'click')

 

Link to comment
Share on other sites

@Danp2 Hello Damp2 Thanks for still trying to help me. 

I tryed the reproducer this is doing nothing for me.

DO you tryed that ?

The wd saying : "Unknow Command" (From my website& the one provided too) If i reproduce your code on it. I dont watched the error code and the reproducer site but it does not work too.

_WD_WaitElement ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/c625e4c8ecd370743627579a9fba11e9/element; $sData={"using":"xpath","value":"//div[@class='awesomeMainDiv']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"e31bc2f7-75ba-48f7-a87e-e70928a9450d"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"e31bc2f7-75ba-48f7-a87e-e70928a9450d"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/c625e4c8ecd370743627579a9fba11e9/actions; $sData={"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"e31bc2f7-75ba-48f7-a87e-e70928a9450d","element-6066-11e4-a52e-4f735466cecf":"e31bc2f7-75ba-48f7-a87e-e70928a9450d"}}]}]}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"unknown command","message":"(Session infochrome=73.0.3683.86)","stacktrace":"Backtrace:\n\tOrdinal0

I ll check WD version to be sure.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

I wasn't up to date with UDF and with WD too. 

But now if i keep my code WD wont start at all... 

WD console

Starting ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

I'm googling but i didn't find my solution yet :( 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Ok, After updating the UDF files nothing in my script is sent as text. 

I presume function had changed. 

If i updated WD the console not working anymore and Chrome isn't started anymore. 

 

Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm. 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

yeah i provided everything in the past posts.

You got console output etc

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

argg... Yes this is the problem when i reply too much i am sorry. 

 

Let restart from Zero :) 

If i update WD alone 

This is my WD console output. 

And then the SciTE output is not needed becose it say it does not found element etc... But normal since chrome isn't started. 

So we only need to know that

Starting ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

If i fix that i guess your code will work for me. 

Fro info

I tryed WD option

;~    _WD_Option('DriverParams', '--whitelisted-ips=' & '127.0.0.1' )
;~    _WD_Option('DriverParams', '--whitelisted-ips=' & '192.168.1.23' )

And also tryed safe zone for my internet = idem

Tryed lot of things... i cant remember... too. 

And i dont want to wast your time ofc... If you feeling this i am sorry. 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

23 minutes ago, Danp2 said:

You haven't posted your Chrome version

Please answer this. Based on your ChromeDriver version, you should be running Version 73.x

24 minutes ago, caramen said:

And then the SciTE output is not needed becose it say it does not found element etc... But normal since chrome isn't started. 

Could still be useful in diagnosing the situation.

Link to comment
Share on other sites

Chrome version :

Version 73.0.3683.103 (Build officiel) (64 bits)

Working stat with missing function = 

WebDriver-0.1.0.15 udf

WD : Unknow version = Modified 13/19/2018 (probably Ver 69 or 70)

 

Non Working stat  = 

All updated version , 

WD : chromedriver_win32v73 (Tryed 74 as well = idem )  

UDF : WebDriver-0.1.0.17

 

SciTE output

Working stat with missing function = 

Classic working output. 

Non Working stat  = 

WD console

Starting ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

Tryed to search google for it. All i found is i have to enable safe zone in all my kind of connexion = idem same issue.

SciTE output

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Pret\OneDrive\Autoit\projet Anah\v2.0.0\Reproducer.au3" /UserParams    
+>16:03:20 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0   Keyboard:0000040C  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:040C)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Pret\OneDrive\Autoit\projet Anah\v2.0.0\Reproducer.au3
+>16:03:21 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\Pret\OneDrive\Autoit\projet Anah\v2.0.0\Reproducer.au3"    
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_WDStartup: OS: WIN_10 WIN32_NT 17134 
_WDStartup: AutoIt: 3.3.14.5
_WDStartup: WD.au3: 0.1.0.17
_WDStartup: Driver: chromedriver.exe
_WDStartup: Params: --log-path="C:\Users\Pret\OneDrive\Autoit\projet Anah\v2.0.0\chrome.log"
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true }}}}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"unrecognized capability: chromeOptions","stacktrace":"Backtrace:\n\tOrdinal0 [0x0038C7B3+1427379]\n\tOrdinal0 [0x003074EE+881902]\n\tOrdinal0 [0x002AA62F+501295]\n\tOrdinal0 [0x0023642B+25643]\n\tOrdinal0 [0x0025F2A4+193188]\n\tOrdinal0 [0x0025F8E8+194792]\n\tOrdinal0 [0x0025F6ED+194285]\n\tOrdinal0 [0x0025E19B+188827]\n\tOrdinal0 [0x00243EA0+81568]\n\tOrdinal0 [0x002453DC+87004]\n\tOrdinal0 [0x00245330+86832]\n\tGetHandleVerifier [0x004423F1+569729]\n\tOrdinal0 [0x0039B383+1487747]\n\tOrdinal0 [0x0039B57D+1488253]\n\tOrdinal0 [0x0039B7DA+1488858]\n\tOrdinal0 [0x00393DA7+1457575]\n\tOrdinal0 [0x0039B1FF+1487359]\n\tOrdinal0 [0x0031D243+971331]\n\tOrdinal0 [0x00329B4B+1022795]\n\tOrdinal0 [0x00329C9A+1023130]\n\tOrdinal0 [0x00328CB5+1019061]\n\tBaseThreadInitThunk [0x76F98494+36]\n\tRtlAreBitsSet [0x772241C8+136]\n\tRtlAreBitsSet [0x77224198+88]\n"}}
_WD_CreateSession: {"value":{"error":"invalid argument","message":"unrecognized capability: chromeOptions","stacktrace":"Backtrace:\n\tOrdinal0 [0x0038C7B3+1427379]\n\tOrdinal0 [0x003074EE+881902]\n\tOrdinal0 [0x002AA62F+501295]\n\tOrdinal0 [0x0023642B+25643]\n\tOrdinal0 [0x0025F2A4+193188]\n\tOrdinal0 [0x0025F8E8+194792]\n\tOrdinal0 [0x0025F6ED+194285]\n\tOrdinal0 [0x0025E19B+188827]\n\tOrdinal0 [0x00243EA0+81568]\n\tOrdinal0 [0x002453DC+87004]\n\tOrdinal0 [0x00245330+86832]\n\tGetHandleVerifier [0x004423F1+569729]\n\tOrdinal0 [0x0039B383+1487747]\n\tOrdinal0 [0x0039B57D+1488253]\n\tOrdinal0 [0x0039B7DA+1488858]\n\tOrdinal0 [0x00393DA7+1457575]\n\tOrdinal0 [0x0039B1FF+1487359]\n\tOrdinal0 [0x0031D243+971331]\n\tOrdinal0 [0x00329B4B+1022795]\n\tOrdinal0 [0x00329C9A+1023130]\n\tOrdinal0 [0x00328CB5+1019061]\n\tBaseThreadInitThunk [0x76F98494+36]\n\tRtlAreBitsSet [0x772241C8+136]\n\tRtlAreBitsSet [0x77224198+88]\n"}}
_WD_CreateSession ==> Webdriver Exception: unrecognized capability: chromeOptions
__WD_Get: URL=HTTP://127.0.0.1:9515/session//window/handles
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0...
_WD_Window: {"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0...
_WD_NewTab ==> Webdriver Exception
__WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://plugins.jquery.com/"}
__WD_Post: StatusCode=200; ResponseText={"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
_WD_Navigate: {"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session//element; $sData={"using":"xpath","value":"//li[@class='dropdown']"}
__WD_Post: StatusCode=200; ResponseText={"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
_WD_FindElement: {"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session//actions; $sData={"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"","element-6066-11e4-a52e-4f735466cecf":""}}]}]}
__WD_Post: StatusCode=200; ResponseText={"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
_WD_Action: {"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
__WD_Delete: URL=HTTP://127.0.0.1:9515/session//actions
__WD_Delete: StatusCode=200; ResponseText={"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
_WD_Action: {"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session//element; $sData={"using":"xpath","value":"//a[@href='https://js.foundation/CLA']"}
__WD_Post: StatusCode=200; ResponseText={"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
_WD_FindElement: {"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session//element//click; $sData={"id":""}
__WD_Post: StatusCode=200; ResponseText={"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.17134 x86_64)"}}
_WD_ElementAction: {"sessionId":"","status":6,"value":{"message":"invalid session id\n  (Driver info: chromedriver=73.0...

Here you got everything. 

Thanks for your patience and your time spend. 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

11 minutes ago, caramen said:

__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true }}}} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"unrecognized capability: chromeOptions","stacktrace":"Backtrace:\n\tOrdinal0 [0x0038C7B3+1427379]\n\tOrdinal0 [0x003074EE+881902]\n\tOrdinal0 [0x002AA62F+501295]\n\tOrdinal0 [0x0023642B+25643]\n\tOrdinal0 [0x0025F2A4+193188]\n\tOrdinal0 [0x0025F8E8+194792]\n\tOrdinal0 [0x0025F6ED+194285]\n\tOrdinal0 [0x0025E19B+188827]\n\tOrdinal0 [0x00243EA0+81568]\n\tOrdinal0 [0x002453DC+87004]\n\tOrdinal0 [0x00245330+86832]\n\tGetHandleVerifier [0x004423F1+569729]\n\tOrdinal0 [0x0039B383+1487747]\n\tOrdinal0 [0x0039B57D+1488253]\n\tOrdinal0 [0x0039B7DA+1488858]\n\tOrdinal0 [0x00393DA7+1457575]\n\tOrdinal0 [0x0039B1FF+1487359]\n\tOrdinal0 [0x0031D243+971331]\n\tOrdinal0 [0x00329B4B+1022795]\n\tOrdinal0 [0x00329C9A+1023130]\n\tOrdinal0 [0x00328CB5+1019061]\n\tBaseThreadInitThunk [0x76F98494+36]\n\tRtlAreBitsSet [0x772241C8+136]\n\tRtlAreBitsSet [0x77224198+88]\n"}} _WD_CreateSession: {"value":{"error":"invalid argument","message":"unrecognized capability: chromeOptions","stacktrace":"Backtrace:\n\tOrdinal0 [0x0038C7B3+1427379]\n\tOrdinal0 [0x003074EE+881902]\n\tOrdinal0 [0x002AA62F+501295]\n\tOrdinal0 [0x0023642B+25643]\n\tOrdinal0 [0x0025F2A4+193188]\n\tOrdinal0 [0x0025F8E8+194792]\n\tOrdinal0 [0x0025F6ED+194285]\n\tOrdinal0 [0x0025E19B+188827]\n\tOrdinal0 [0x00243EA0+81568]\n\tOrdinal0 [0x002453DC+87004]\n\tOrdinal0 [0x00245330+86832]\n\tGetHandleVerifier [0x004423F1+569729]\n\tOrdinal0 [0x0039B383+1487747]\n\tOrdinal0 [0x0039B57D+1488253]\n\tOrdinal0 [0x0039B7DA+1488858]\n\tOrdinal0 [0x00393DA7+1457575]\n\tOrdinal0 [0x0039B1FF+1487359]\n\tOrdinal0 [0x0031D243+971331]\n\tOrdinal0 [0x00329B4B+1022795]\n\tOrdinal0 [0x00329C9A+1023130]\n\tOrdinal0 [0x00328CB5+1019061]\n\tBaseThreadInitThunk [0x76F98494+36]\n\tRtlAreBitsSet [0x772241C8+136]\n\tRtlAreBitsSet [0x77224198+88]\n"}} _WD_CreateSession ==> Webdriver Exception: unrecognized capability: chromeOptions

Told you the Scite output could help. 😏

You need to change "chromeOptions" to "goog:chromeOptions"

Link to comment
Share on other sites

And now everything work. 

The li mouse over the click.... 

Thanks lol... apologise for my multiple reply that make everything confuse

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • 2 weeks later...

Hello at all,

my script is running very well, but I have a little problem.

I have to input data in a big table with many lines in some cells by each line.

This works perfectly on all lines and cells there are visible in the window of the browser.

I have to click on a cell to open a modal-form to input the data and to click on the save button.

But if I try to click on a cell that it out of the window of the browser, than I get a error that

the cell is NOT click-able.

If I am scroll the the window manually by mouse or by arrow-key during the script is running,

everything runs well.

I believe I am needing a command to scroll down the window after finishing some lines.

How can I scroll the window ?

Link to comment
Share on other sites

12 minutes ago, Danp2 said:

@Hamburgo You could try manually calling the element's scrollIntoView function. Something like this --

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='q1']")
_WD_ExecuteScript($sSession, "arguments[0].scrollIntoView(true);", $sElement)

 

@Danp2 Thanks, for your tip. Your command scrolls the window, but not enough.

The reason will be, that the windows has on the bottom a bar, they show the time of rest

to timeout.

The scrolled element will be exactly behing the bar and is still not click-able.

Is it possible to scroll by pixel ?

 

Link to comment
Share on other sites

You can try changing true to false, which could help. Otherwise, you will need to look at the other available options for this function.

Another option would be to pick a different element located below the current one and call the same scrollIntoView function for it, which would theoretically bring the original element into view.

Link to comment
Share on other sites

48 minutes ago, Danp2 said:

You can try changing true to false, which could help. Otherwise, you will need to look at the other available options for this function.

Another option would be to pick a different element located below the current one and call the same scrollIntoView function for it, which would theoretically bring the original element into view.

Independent if I set true or false for  scrollIntoView I got the message:

__WD_Post: URL=HTTP://127.0.0.1:4444/session/46daaa17-c2d6-4e45-9303-145d9b407d4a/execute/sync; $sData={"script":"arguments[0].scrollIntoView?(true);", "args":[f40e9d66-4e4f-4696-a31a-2b08330e72af]}

__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"script\":\"arguments[0].scrollIntoView(true);\", \"args\":[f40e9d66-4e4f-4696-a31a-2b08330e72af]}","stacktrace":"Syntax error at :1:61"}}

_WD_ExecuteScript: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"script\":\"arguments[0].scrollIntoView(true);\", \"args\":[f40e9d66-4e4f-4696-a31a-2b08330e72af]}","stacktrace":"Syntax error at :1:61"}}

Can it be the reason that it scrolls, but not enough ?

Link to comment
Share on other sites

2 hours ago, Hamburgo said:

Can it be the reason that it scrolls, but not enough ?

The Webdriver automatically attempts to scroll the element into view if needed. This is likely the scrolling you are observing since the _WD_ExecuteScript is actually failing. Looks like you need to modify the value representing the element being passed as a parameter. I tested the following and it executed correctly --

_WD_ExecuteScript($sSession, "arguments[0].scrollIntoView(true);", '{"' & $_WD_ELEMENT_ID & '":"' & $sElement & '"}')

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...