Jump to content

WebDriver UDF - Help & Support


Recommended Posts

@Danp2 I have tried command a. to c. out of success. Your command d. was successful !

a.      $sValue = _WD_ElementAction($sSession, $aOptions[$i], 'value')

b.      $sValue = _WD_ElementAction($sSession, $aOptions[$i], 'property')

c.      $sValue = _WD_ElementAction($sSession, $aOptions[$i], 'attribute')

d.      $sValue = _WD_ElementAction($sSession, $aOptions[$i], 'attribute', 'value')

 

Many thanks.

Link to comment
Share on other sites

<tr>
</tr>
<tr>
</tr>
<tr data-id="0" class="even">
</tr>
<tr data-id="1" class="even">
</tr>
<tr data-id="2" class="even">
</tr>
<tr data-id="3" class="even">
</tr>
<tr data-id="4" class="even">
</tr>
<tr>
</tr>
<tr>
</tr>

Is it possible to find all the elements table rows with the attribut/property "data-id" with the function _WD_FindElement ?

 

<input id="SopEmployee_status" name="SopEmployee[status]" value="ALL" type="checkbox" checked>

LAST question for today: How can I check if a CheckBox like that is checked or not ?

Many thanks in advance.

Link to comment
Share on other sites

45 minutes ago, Hamburgo said:

Is it possible to find all the elements table rows with the attribut/property "data-id" with the function _WD_FindElement ?

Yes, it should be possible with the appropriate xpath selector. What have you tried thus far?

46 minutes ago, Hamburgo said:

How can I check if a CheckBox like that is checked or not ?

http://bfy.tw/NWSU

:thumbsup:

Link to comment
Share on other sites

15 hours ago, Hamburgo said:

I am tried nothing, because I do not found anything about that on https://devhints.io/xpath
So I have no idea what can be the syntax.

 

answer by myself:

$aTableRows = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr", '', True)

    _ArrayDisplay($aTableRows, "a. Table-Rows:")

    $aTableRows = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr[@data-id]", '', True)

    _ArrayDisplay($aTableRows, "b. Table-Rows[@data-id]:")

    $aTableRows = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr[@data-id='2']", '', True)

    _ArrayDisplay($aTableRows, "c. Table-Rows[@data-id='2']:")


 

Link to comment
Share on other sites

Hi Dan,

Great Thanks for your help.
 

I improved the function : as you can see i replaced the "StartElement" parameter by an  option value parameter (that i did not understood well sorry...)

The option value parameter is the value you want to select on your listbox.


You Can try the new function on the demo code  and improve it for sure :)

 

Func DemoNavigation()


_WD_Window($sSession, "maximize")
_WD_Navigate($sSession, "https://www.nvidia.fr/Download/index.aspx?lang=fr")

_WD_OptionSelectElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='selProductSeriesType']/option", "tesla")

EndFunc

The new function : 

Func _WD_OptionSelectElement($sSession, $sStrategy, $sSelector, $OptionValue)

    Local $aElements
    Local $DicElements
    Local $i
    Local $Rslt

    Local $sElement

    $DicElements = objcreate("Scripting.Dictionary")

;~     $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//select[@id='selProductSeriesType']/option", '', True)
    $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sSelector, '', True)

;~     _ArrayDisplay($aElements)


    For $i = 0 to Ubound($aElements) - 1

        $IdElement = $aElements[$i]

;~         print($IdElement)

        $TmpElement = _WD_ElementAction($sSession, $IdElement, 'text', 'value')
        $DicElements.Add(String($i),String($TmpElement))

;~         print($ValueElement)

    Next

    for $i = 1 To $DicElements.Count

        $TmpElement = $DicElements(String($i))

                if  $TmpElement = $OptionValue then

                    $Rslt = $i + 1
                    Exitloop

                Else

                    $Rslt = 0

                EndIf

    Next

    If $Rslt <> 0 Then

        $sElement = _WD_FindElement($sSession, $sStrategy, $sSelector & "[" & $Rslt & "]", "")

            If @error = $_WD_ERROR_Success Then
                _WD_ElementAction($sSession, $sElement, 'click')
            EndIf

    Else
             Consolewrite("Value : " & $OptionValue & " is not present on the element : " &  $sSelector &  "")

    EndIf

EndFunc

Link to comment
Share on other sites

Hi Dan,

I'm very glad with your UDF. All works pefectly, except for one thing:

I can not multiselect with xpath. The user does it pressing control and with the mouse, selects all desired options.

 I'm trying to do with the pipe:

Quote

 $searchForm = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body[@class=' app-users model-user change-form']/div[@id='container']/div[@id='content']/div[@id='content-main']/form[@id='user_form']/div/fieldset[@class='module aligned ']/div[@class='form-row field-groups']/div/div[@class='related-widget-wrapper']/select[@id='id_groups']/option[@value='1'] | /html/body[@class=' app-users model-user change-form']/div[@id='container']/div[@id='content']/div[@id='content-main']/form[@id='user_form']/div/fieldset[@class='module aligned ']/div[@class='form-row field-groups']/div/div[@class='related-widget-wrapper']/select[@id='id_groups']/option[@value='2'] ")

_WD_ElementAction($sSession, $searchForm, 'click')

But doesn't works.

Also i've tried to specify multiselection in _WD_FindElement, adding True, but didn't worked for me:

Quote

 $searchForm = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/select[@id='id_groups']/option[@value='1'] | /select[@id='id_groups']/option[@value='2'] ","",True)

_WD_ElementAction($sSession, $searchForm, 'click')

Or adding all atributes I want together, with and /or but didn't worked:

Quote

 $searchForm = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/select[@id='id_groups']/option[@value='1' | @value='2'] ","",True)

_WD_ElementAction($sSession, $searchForm, 'click')

Is there a way to do multiselect without using "send" autoit function for keypress?

Thanks and regards,

Link to comment
Share on other sites

20190507232420.png.6a521e01e675166cdceec4e8ee8a0f4a.png

 

As shown above, clicking on the sign in link will pop up a window-like page.

Please help me: how do I move from the original page to the newly pop-up window-like page and locate the elements?

My code is as follows:

#include "wd_core.au3"
#include "wd_helper.au3"
Local $url1 = "https://www.autoitscript.com/forum/"

Local $sDesiredCapabilities
_setupFirefox()
_WD_Startup()
Local $Session=_WD_CreateSession($sDesiredCapabilities)
Sleep(1000)
_WD_Navigate($Session, $url1)
Sleep(1000)

local $sSign_in=_WD_FindElement($Session, $_WD_LOCATOR_ByPartialLinkText,'Sign In')
_WD_ElementAction($Session,$sSign_in, 'click')
Sleep(500)

;Starting with the following code, there is no response and seems to remain on the original web page
local $uElement = _WD_FindElement($Session, $_WD_LOCATOR_ByXPath, '//*[@id="elUserSignIn_internal"]/div/ul/li[1]/input')
_WD_ElementAction($Session, $uElement, 'value', "username123")
Sleep(500)
local $pElement = _WD_FindElement($Session, $_WD_LOCATOR_ByXPath, '//*[@id="elUserSignIn_internal"]/div/ul/li[2]/input')
_WD_ElementAction($Session, $pElement, 'value', "Password321")
Sleep(500)

local $sElement = _WD_FindElement($Session, $_WD_LOCATOR_ByXPath, '//*[@id="elSignIn_submit"]')
_WD_ElementAction($Session, $sElement, 'click')

func _setupFirefox()
    $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'
    _WD_Option('Driver', 'geckodriver.exe')
    _WD_Option('DriverParams', '--log trace')
    _WD_Option('Port', 4444)
EndFunc

 

Link to comment
Share on other sites

_WDStartup: OS:WIN_7 WIN32_NT 7601 Service Pack 1

    _WDStartup: AutoIt:3.3.14.2

    _WDStartup: WD.au3:0.1.0.17

    _WDStartup: Driver:geckodriver.exe

    _WDStartup: Params:--log trace

    _WDStartup: Port:4444

    __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}

    __WD_Post: StatusCode=200; ResponseText={"value":{"sessionId":"e7347278-b657-4bf8-8c8a-e01d6f4f0611","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"66.0.3","javascriptEnabled":true,"moz:accessibilityChecks":false,"moz:geckodriverVersion":"0.24.0","moz:headless":false,"moz:processID":5936,"moz:profile":"X:\\MESS\\TEMP\\user\\rust_mozprofile.SyLiP6uzUviF","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"nativeEvents":true,"pageLoadStrategy":"normal","platformName":"windows","platformVersion":"6.1","rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss  notify"}}}

    _WD_CreateSession: {"value":{"sessionId":"e7347278-b657-4bf8-8c8a-e01d6f4f0611","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"66.0.3","javascriptEnabled":true,"moz:accessibilityChecks":false,"moz:geckodriverVersion":"0.24.0","moz:headless":false,"moz:processID":5936,"moz:profile":"X:\\MESS\\TEMP\\user\\rust_mozprofile.SyLiP6uzUviF","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"nativeEvents":true,"pageLoadStrategy":"normal","platformName":"windows","platformVersion":"6.1","rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss  notify"}}}

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/url; $sData={"url":"https://www.autoitscript.com/forum/"}

    __WD_Post: StatusCode=200; ResponseText={"value":null}

    _WD_Navigate: {"value":null}

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element; $sData={"using":"partial link text","value":"Sign In"}

    __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"17ba1cd7-e9a5-4701-b5a6-a6c0d32f8c6d"}}

    _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"17ba1cd7-e9a5-4701-b5a6-a6c0d32f8c6d"}}

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element/17ba1cd7-e9a5-4701-b5a6-a6c0d32f8c6d/click; $sData={"id":"17ba1cd7-e9a5-4701-b5a6-a6c0d32f8c6d"}

    __WD_Post: StatusCode=200; ResponseText={"value":null}

    _WD_ElementAction: {"value":null}...

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element; $sData={"using":"xpath","value":"//*[@id="elUserSignIn_internal"]/div/ul/li[1]/input"}

    __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elUserSignIn_internal\"]/div/ul/li[1]/input\"}","stacktrace":"语法错误 at :1:36"}}

    _WD_FindElement: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elUserSignIn_internal\"]/div/ul/li[1]/input\"}","stacktrace":"语法错误 at :1:36"}}

    _WD_FindElement ==> Webdriver Exception: HTTP status = 400

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//value; $sData={"id":"", "text":"username123"}

    __WD_Post: StatusCode=404; ResponseText={"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//value did not match a known command","stacktrace":""}}

    _WD_ElementAction: {"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/el...

    _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//value did not match a known command","stacktrace":""}}

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element; $sData={"using":"xpath","value":"//*[@id="elUserSignIn_internal"]/div/ul/li[2]/input"}

    __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elUserSignIn_internal\"]/div/ul/li[2]/input\"}","stacktrace":"语法错误 at :1:36"}}

    _WD_FindElement: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elUserSignIn_internal\"]/div/ul/li[2]/input\"}","stacktrace":"语法错误 at :1:36"}}

    _WD_FindElement ==> Webdriver Exception: HTTP status = 400

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//value; $sData={"id":"", "text":"Password321"}

    __WD_Post: StatusCode=404; ResponseText={"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//value did not match a known command","stacktrace":""}}

    _WD_ElementAction: {"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/el...

    _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//value did not match a known command","stacktrace":""}}

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element; $sData={"using":"xpath","value":"//*[@id="elSignIn_submit"]"}

    __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elSignIn_submit\"]\"}","stacktrace":"语法错误 at :1:36"}}

    _WD_FindElement: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elSignIn_submit\"]\"}","stacktrace":"语法错误 at :1:36"}}

    _WD_FindElement ==> Webdriver Exception: HTTP status = 400

    __WD_Post: URL=HTTP://127.0.0.1:4444/session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//click; $sData={"id":""}

    __WD_Post: StatusCode=404; ResponseText={"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//click did not match a known command","stacktrace":""}}

    _WD_ElementAction: {"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/el...

    _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"unknown command","message":"POST /session/e7347278-b657-4bf8-8c8a-e01d6f4f0611/element//click did not match a known command","stacktrace":""}}

Xpath is obtained through the developer tool F12 console.As an exercise,so take this forum login example. Dear Danp2, if you did this login, how would you write the code?More Thanks in advance!

Edited by Letraindusoir
Link to comment
Share on other sites

surely It seems that there's something wrong with the "xpath".It's like different browsers produce different xpath.:(

local $uElement = _WD_FindElement($Session, $_WD_LOCATOR_ByXPath, '/html/body/div[5]/form/div/div/div[1]/div/ul/li[1]/input')

local $pElement = _WD_FindElement($Session, $_WD_LOCATOR_ByXPath, '/html/body/div[5]/form/div/div/div[1]/div/ul/li[2]/input')

local $sElement = _WD_FindElement($Session, $_WD_LOCATOR_ByXPath, '//*[@id="elSignIn_submit"]')

now The errors that occur are as follows:

__WD_Post: URL=HTTP://127.0.0.1:4444/session/7c0c13f9-5c13-4851-9c47-365d0d196988/element; $sData={"using":"xpath","value":"//*[@id="elSignIn_submit"]"}
__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elSignIn_submit\"]\"}","stacktrace":"语法错误 at :1:36"}}
_WD_FindElement: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"using\":\"xpath\",\"value\":\"//*[@id=\"elSignIn_submit\"]\"}","stacktrace":"语法错误 at :1:36"}}
_WD_FindElement ==> Webdriver Exception: HTTP status = 400

 '//*[@id="elSignIn_submit"]' is wrong.....,,but it is obtained through the developer tool:(

Link to comment
Share on other sites

Hi Dan,

Trying to multi select, using pipe(|) to do an 'and':

$searchForm = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/div/div[@class='related-widget-wrapper']/select[@id='id_groups']/option[@value='1']|/div/div[@class='related-widget-wrapper']/select[@id='id_groups']/option[@value='2']","",True)
 _WD_ElementAction($sSession, $searchForm, 'click')

Gives this output from scite:

__WD_Post: URL=HTTP://127.0.0.1:9515/session/704aa4764b4c7093c86841188c8d1c90/elements; $sData={"using":"xpath","value":"/div/div[@class='related-widget-wrapper']/select[@id='id_groups']/option[@value='1']|/div/div[@class='related-widget-wrapper']/select[@id='id_groups']/option[@value='2']"}
__WD_Post: StatusCode=200; ResponseText={"value":[{"element-6066-11e4-a52e-4f735466cecf":"669755b1-d4d1-4332-9460-f5b9660a912f"},{"element-6066-11e4-a52e-4f735466cecf":"07538cd6-0e65-46c2-abe2-20c53430c9f4"}]}
_WD_FindElement: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"669755b1-d4d1-4332-9460-f5b9660a912f"},{"element-6066-11e4-a52e-4f735466cecf":"07538cd6-0e65-46c2-abe2-20c53430c9f4"}]}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/704aa4764b4c7093c86841188c8d1c90/element//click; $sData={"id":""}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"stale element reference","message":"element is not attached to the page document\n  (Session info: chrome=73.0.3683.103)","stacktrace":"Backtrace:\n\tOrdinal0 [0x011D6170+1597808]\n\tOrdinal0 [0x01132DCD+929229]\n\tOrdinal0 [0x010D6BFF+551935]\n\tOrdinal0 [0x010D87CA+559050]\n\tOrdinal0 [0x010D86B4+558772]\n\tOrdinal0 [0x0106A7D0+108496]\n\tOrdinal0 [0x010660CD+90317]\n\tOrdinal0 [0x0107AD1D+175389]\n\tOrdinal0 [0x01065E68+89704]\n\tOrdinal0 [0x0107AFA1+176033]\n\tOrdinal0 [0x010825CB+206283]\n\tOrdinal0 [0x0107ABBB+175035]\n\tOrdinal0 [0x01063DA0+81312]\n\tOrdinal0 [0x0106535C+86876]\n\tOrdinal0 [0x010652B0+86704]\n\tGetHandleVerifier [0x0128D741+577025]\n\tOrdinal0 [0x011E5573+1660275]\n\tOrdinal0 [0x011E574D+1660749]\n\tOrdinal0 [0x011E599A+1661338]\n\tOrdinal0 [0x011DDEA7+1629863]\n\tOrdinal0 [0x011E53EF+1659887]\n\tOrdinal0 [0x0114870E+1017614]\n\tOrdinal0 [0x0115489B+1067163]\n\tOrdinal0 [0x011549EA+1067498]\n\tOrdinal0 [0x01153A75+1063541]\n\tBaseThreadInitThunk [0x74408764+36]\n\tRtlGetAppContainerNamedObjectPath [0x778C58ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x778C58BD+205]\n"}}
_WD_ElementAction: {"value":{"error":"stale element reference","message":"element is not attached to the page document\...
_WD_ElementAction ==> No match: {"value":{"error":"stale element reference","message":"element is not attached to the page document\n  (Session info: chrome=73.0.3683.103)","stacktrace":"Backtrace:\n\tOrdinal0 [0x011D6170+1597808]\n\tOrdinal0 [0x01132DCD+929229]\n\tOrdinal0 [0x010D6BFF+551935]\n\tOrdinal0 [0x010D87CA+559050]\n\tOrdinal0 [0x010D86B4+558772]\n\tOrdinal0 [0x0106A7D0+108496]\n\tOrdinal0 [0x010660CD+90317]\n\tOrdinal0 [0x0107AD1D+175389]\n\tOrdinal0 [0x01065E68+89704]\n\tOrdinal0 [0x0107AFA1+176033]\n\tOrdinal0 [0x010825CB+206283]\n\tOrdinal0 [0x0107ABBB+175035]\n\tOrdinal0 [0x01063DA0+81312]\n\tOrdinal0 [0x0106535C+86876]\n\tOrdinal0 [0x010652B0+86704]\n\tGetHandleVerifier [0x0128D741+577025]\n\tOrdinal0 [0x011E5573+1660275]\n\tOrdinal0 [0x011E574D+1660749]\n\tOrdinal0 [0x011E599A+1661338]\n\tOrdinal0 [0x011DDEA7+1629863]\n\tOrdinal0 [0x011E53EF+1659887]\n\tOrdinal0 [0x0114870E+1017614]\n\tOrdinal0 [0x0115489B+1067163]\n\tOrdinal0 [0x011549EA+1067498]\n\tOrdinal0 [0x01153A75+1063541]\n\tBaseThreadInitThunk [0x74408764+36]\n\tRtlGetAppContainerNamedObjectPath [0x778C58ED+253]\n\tRtlGetAppContainerNamedObjectPath [0x778C58BD+205]\n"}}

No matter if I put the True statement related to multiselect in _WD_FindElement

Is there a way to multiselect? Like a user does with control key pressed and then selects it with the mouse.

Thanks in advance!

Ansal

Link to comment
Share on other sites

@Danp2 I tried to get the tagName of a element, but out of success.
 

13.6 Get Element Tag Name
HTTP Method     URI Template
GET     /session/{session id}/element/{element id}/name

my command:

$sValue = _WD_ElementAction($sSession, $sElement, 'name')
     MsgBox(4096, "Webdriver | Function: TestPage: ", "A. pices-type: >" & $sValue &  "<")

message:

__WD_Get: URL=HTTP://127.0.0.1:4444/session/cb79aaa6-a452-41b8-bcfd-11e89655c9b0/element//name
__WD_Get: StatusCode=404; $iResult = 0; $sResponseText={"value":{"error":"unknown command","message":"GET /session/cb79aaa6-a452-41b8-bcfd-11e89655c9b0/ele...
_WD_ElementAction: {"value":{"error":"unknown command","message":"GET /session/cb79aaa6-a452-41b8-bcfd-11e89655c9b0/ele...
_WD_ElementAction ==> Webdriver Exception: {"value":{"error":"unknown command","message":"GET /session/cb79aaa6-a452-41b8-bcfd-11e89655c9b0/element//name did not match a known command","stacktrace":""}}

Where is my mistake ?

Link to comment
Share on other sites

3 hours ago, ansal said:

_WD_FindElement: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"669755b1-d4d1-4332-9460-f5b9660a912f"},{"element-6066-11e4-a52e-4f735466cecf":"07538cd6-0e65-46c2-abe2-20c53430c9f4"}]}

This shows that the call to _WD_FindElement successfully returned an array of elements. It appears that your issue is that you are then attempting to pass this array to _WD_ElementAction, which isn't valid. You'll need to pass each element you want to click as a parameter on separate calls to _WD_ElementAction if you need to click more than one element.

Link to comment
Share on other sites

3 hours ago, Hamburgo said:

Where is my mistake ?

Unable to tell without additional details. It could be an issue with the particular version of the Webdriver console you are using. You could try switching to a different browser and testing to see if the issue goes away. If so, then you've isolated it to a particular browser / webdriver version.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...