Jump to content
Danp2

WebDriver UDF - Help & Support

Recommended Posts

21 hours ago, Danp2 said:

The UDF is designed to run with webdrivers supporting the current W3C standard.

Please explain why you insist on testing with such out of date versions of Chrome / Chromedriver?

I want to try to automate some user activity in the application called "Oracle Siebel CRM". In short, the ancient shit for enterprise, witch works only with IE and Chrome 59.

Share this post


Link to post
Share on other sites
8 minutes ago, slvtn666 said:

I want to try to automate some user activity in the application called "Oracle Siebel CRM". In short, the ancient shit for enterprise, witch works only with IE and Chrome 59.

Strange that it would only support Chrome up to v59. What version of IE does it support?

Share this post


Link to post
Share on other sites

As I told, I am working on getting the details of the elements on a page. Can any one please suggest where can I search for the options to use with 'attribute', 'property' and  'css' commands on _WD_ElementAction. I have read the details on https://w3c.github.io/webdriver/webdriver-spec.html#element-state, but couldn't find the options to use.

Can anyone please help?

Share this post


Link to post
Share on other sites

Need help, my automatic test stays in iframe

_WDStartup: OS: WIN_10 WIN32_NT 14393 
_WDStartup: AutoIt: 3.3.14.2
_WDStartup: WD.au3: 0.1.0.10
_WDStartup: Driver: chromedriver.exe
_WDStartup: Params: --log-path="G:\WebDriver\chrome.log"
_WDStartup: Port:   9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true }}}}
__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab)","userDataDir":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\scoped_dir4328_23411"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"setWindowRect":true,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"67.0.3396.99","webStorageEnabled":true},"sessionId":"ab33649d86852438db5447ae22510b76"}}
_WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab)","userDataDir":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\scoped_dir4328_23411"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"setWindowRect":true,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"67.0.3396.99","webStorageEnabled":true},"sessionId":"ab33649d86852438db5447ae22510b76"}}
Running: GLGLAuto
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/url; $sData={"url":"http://www.glgl.cc:8088/Login.aspx"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_Navigate: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element; $sData={"using":"xpath","value":"//input[@id='T_uid']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"a2b414a7-1ef9-4773-b991-58c579de5878"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"a2b414a7-1ef9-4773-b991-58c579de5878"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element/a2b414a7-1ef9-4773-b991-58c579de5878/clear; $sData={"id":"a2b414a7-1ef9-4773-b991-58c579de5878"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_ElementAction: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element/a2b414a7-1ef9-4773-b991-58c579de5878/value; $sData={"id":"a2b414a7-1ef9-4773-b991-58c579de5878", "text":"5300", "value":["5","3","0","0"]}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_ElementAction: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element; $sData={"using":"xpath","value":"//input[@id='T_pwd']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"f55b0de1-e1ab-409c-b1fa-feb58c7cddc8"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"f55b0de1-e1ab-409c-b1fa-feb58c7cddc8"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element/f55b0de1-e1ab-409c-b1fa-feb58c7cddc8/value; $sData={"id":"f55b0de1-e1ab-409c-b1fa-feb58c7cddc8", "text":"789456", "value":["7","8","9","4","5","6"]}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_ElementAction: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element; $sData={"using":"xpath","value":"//div[@id='ligerui1002']/table/tbody/tr[2]/td[2]/div/div[2]/div/div/div[3]"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"7f9052b8-b4b8-404b-b106-4325da4e4a61"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"7f9052b8-b4b8-404b-b106-4325da4e4a61"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element/7f9052b8-b4b8-404b-b106-4325da4e4a61/click; $sData={"id":"7f9052b8-b4b8-404b-b106-4325da4e4a61"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_ElementAction: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element; $sData={"using":"xpath","value":"//div[@id='toolbar']/div[4]/span"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"15b309f9-a478-4f80-8b35-1a5191787dbb"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"15b309f9-a478-4f80-8b35-1a5191787dbb"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element/15b309f9-a478-4f80-8b35-1a5191787dbb/click; $sData={"id":"15b309f9-a478-4f80-8b35-1a5191787dbb"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_ElementAction: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element; $sData={"using":"xpath","value":"//div[@id='accordion1']/div[2]/ul/li/span"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"5383702e-6bc1-408a-b5a1-182b21d5dc70"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"5383702e-6bc1-408a-b5a1-182b21d5dc70"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element/5383702e-6bc1-408a-b5a1-182b21d5dc70/click; $sData={"id":"5383702e-6bc1-408a-b5a1-182b21d5dc70"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_ElementAction: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/frame; $sData={"id":{"element-6066-11e4-a52e-4f735466cecf":"tabid60"}}
__WD_Post: StatusCode=500; ResponseText={"value":{"error":"unknown error","message":"missing 'ELEMENT'(Session infochrome=67.0.3396.99)","stacktrace":"Backtrace:\n\tOrdinal0 [0x013BDF70+778096]\n\tOrdinal0 [0x0136B42D+439341]\n\tOrdinal0 [0x0134807F+295039]\n\tOrdinal0 [0x01330619+198169]\n\tOrdinal0 [0x01328349+164681]\n\tOrdinal0 [0x0132F96B+194923]\n\tOrdinal0 [0x0132824F+164431]\n\tOrdinal0 [0x01311B45+72517]\n\tOrdinal0 [0x01312F2A+77610]\n\tOrdinal0 [0x01312ECC+77516]\n\tGetHandleVerifier [0x01459936+3478]\n\tOrdinal0 [0x013C88C3+821443]\n\tOrdinal0 [0x01377066+487526]\n\tOrdinal0 [0x01377393+488339]\n\tOrdinal0 [0x013774A3+488611]\n\tOrdinal0 [0x013CAA67+830055]\n\tOrdinal0 [0x01376DAF+486831]\n\tOrdinal0 [0x013813FE+529406]\n\tOrdinal0 [0x0138C57B+574843]\n\tOrdinal0 [0x0138C6CD+575181]\n\tOrdinal0 [0x0138B92B+571691]\n\tBaseThreadInitThunk [0x74EA62C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x77EA0FA9+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x77EA0F74+1028]\n"}}
_WD_Window: {"value":{"error":"unknown error","message":"missing 'ELEMENT'(Session infochrome=67.0.3396.99)","stacktrace":"Backtrace:\n\tOrdinal0 [0x013BDF70+778096]\n\tOrdinal0 [0x0136B42D+439341]\n\tOrdinal0 [0x0134807F+295039]\n\tOrdinal0 [0x01330619+198169]\n\tOrdinal0 [0x01328349+164681]\n\tOrdinal0 [0x0132F96B+194923]\n\tOrdinal0 [0x0132824F+164431]\n\tOrdinal0 [0x01311B45+72517]\n\tOrdinal0 [0x01312F2A+77610]\n\tOrdinal0 [0x01312ECC+77516]\n\tGetHandleVerifier [0x01459936+3478]\n\tOrdinal0 [0x013C88C3+821443]\n\tOrdinal0 [0x01377066+487526]\n\tOrdinal0 [0x01377393+488339]\n\tOrdinal0 [0x013774A3+488611]\n\tOrdinal0 [0x013CAA67+830055]\n\tOrdinal0 [0x01376DAF+486831]\n\tOrdinal0 [0x013813FE+529406]\n\tOrdinal0 [0x0138C57B+574843]\n\tOrdinal0 [0x0138C6CD+575181]\n\tOrdinal0 [0x0138B92B+571691]\n\tBaseThreadInitThunk [0x74EA62C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x77EA0FA9+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x77EA0F74+1028]\n"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element; $sData={"using":"xpath","value":"//*[@id='toolbar']/div[2]/span"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"b06ac027-ea0b-4141-a22d-48412e0dca2d"}}
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"b06ac027-ea0b-4141-a22d-48412e0dca2d"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ab33649d86852438db5447ae22510b76/element/b06ac027-ea0b-4141-a22d-48412e0dca2d/click; $sData={"id":"b06ac027-ea0b-4141-a22d-48412e0dca2d"}
__WD_Post: StatusCode=200; ResponseText={"value":null}
_WD_ElementAction: {"value":null}

frame.jpg.b513342b529c0d46e12ab621e34e24ec.jpg

Share this post


Link to post
Share on other sites
Did you look at the examples in wd_test.au3?

I did some research on getting the attribute values and posting the links found and some sample codes here. Hope it will help people like me who are new to webdriver concepts.

options for attributes

How to get options to use with attribute command on _WD_ElementAction

$sCommand = 'attribute'
        $sOption = 'class'
        $sRes = _WD_ElementAction($sSession, $sElementId, $sCommand, $sOption) 
        
        $sCommand = 'attribute'
        $sOption = 'name'
        $sRes = _WD_ElementAction($sSession, $sElementId, $sCommand, $sOption) 
        
        $sCommand = 'attribute'
        $sOption = 'id'
        $sRes = _WD_ElementAction($sSession, $sElementId, $sCommand, $sOption) 
        
        $sCommand = 'attribute'
        $sOption = 'status'
        $sRes = _WD_ElementAction($sSession, $sElementId, $sCommand, $sOption) 
        
        $sCommand = 'attribute'
        $sOption = 'aria-label'
        $sRes = _WD_ElementAction($sSession, $sElementId, $sCommand, $sOption) 
        
        $sCommand = 'attribute'
        $sOption = 'href'
        $sRes = _WD_ElementAction($sSession, $sElementId, $sCommand, $sOption)

 

Share this post


Link to post
Share on other sites

    _WD_Navigate($sSession, "http://www.glgl.cc:8088/Login.aspx")
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='T_uid']")
    _WD_ElementAction($sSession, $sElement, 'clear')
    Sleep(500)
    _WD_ElementAction($sSession, $sElement, 'value', "****")
    Sleep(500)
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='T_pwd']")
    _WD_ElementAction($sSession, $sElement, 'value', "")
    Sleep(200)
    Send("{ENTER}")
    Sleep(500)
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='ligerui1002']/table/tbody/tr[2]/td[2]/div/div[2]/div/div/div[3]")
    _WD_ElementAction($sSession, $sElement, 'click')
    Sleep(200)
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='toolbar']/div[4]/span")
    _WD_ElementAction($sSession, $sElement, 'click')
    Sleep(200)
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='accordion1']/div[2]/ul/li/span")
    _WD_ElementAction($sSession, $sElement, 'click')
    Sleep(200)
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='framecenter']/div[2]/div[2]")
    _WD_FrameEnter($sSession, $sElement)
    Sleep(300)
    $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='toolbar']/div[2]/span")

Share this post


Link to post
Share on other sites

On Chrome getting a property always results in an error from driver

unknown command: session/6db9b39372f1e39e3cf593ed4e70adba/element/880fa92f-cd9f-4fd9-bef2-079d2669d8ff/property/value

 

$sRes = _WD_ElementAction($sSession, $sElement, 'property', 'value')

Any hint to the problem?

Share this post


Link to post
Share on other sites
9 minutes ago, Danp2 said:

@PoojaKrishna Chrome seems to be behind on implementing the webdriver W3C specs. See here for details on this particular matter.

Also, you can get an overall view of their implementation status here.

 

Thank you so much for the reply Danp2. Yes, the bug is still open on the following link:

Get Property Bug on Chrome

And Get Rect too has issues with some elements. Is there any other known way to get the size and location of an element?

Share this post


Link to post
Share on other sites
45 minutes ago, PoojaKrishna said:

And Get Rect too has issues with some elements.

Can you provide some examples where this doesn't work?

46 minutes ago, PoojaKrishna said:

Is there any other known way to get the size and location of an element?

Probably could retrieve the values using _WD_ExecuteScript / Javascript.

Share this post


Link to post
Share on other sites
11 minutes ago, Danp2 said:

Can you provide some examples where this doesn't work?

Probably could retrieve the values using _WD_ExecuteScript / Javascript.

Can You please see my reply on page 9, Posted Wednesday at 03:08 PM regarding the rect? I have posted a screen shot also there. The element I try to get rect  is highlighted on image. Not only the element on that page, but that is a sample.

Share this post


Link to post
Share on other sites

Seems to be Chrome Driver does not support "property" command

But Chrome and Firefox both support "attribute" command

Local $sRes = _WD_ElementAction($sSession, $sElement, 'attribute', 'value')

Saludos

Share this post


Link to post
Share on other sites
14 hours ago, Danp2 said:

@PoojaKrishna Yes, I remember that now. I believe I took a quick look at it back then, but I'll have another look. It's possible that we'll need to file a bug report with the Chromedriver folks.

Yes, I'm attaching the responses we receive back from the web driver in both cases. 

On Success:

{"value":{"height":28,"width":370,"x":498,"y":294}}

On Error: 

{"value":{"error":"unknown error","message":"getting size failed to return x(Session infochrome=67.0.3396.99)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0098DF70+778096]\n\tOrdinal0 [0x0093B42D+439341]\n\tOrdinal0 [0x0091807F+295039]\n\tOrdinal0 [0x008E5D2D+89389]\n\tOrdinal0 [0x008F8349+164681]\n\tOrdinal0 [0x008E39C0+80320]\n\tOrdinal0 [0x008F8521+165153]\n\tOrdinal0 [0x008FF96B+194923]\n\tOrdinal0 [0x008F824F+164431]\n\tOrdinal0 [0x008E1B45+72517]\n\tOrdinal0 [0x008E2F2A+77610]\n\tOrdinal0 [0x008E2ECC+77516]\n\tGetHandleVerifier [0x00A29936+3478]\n\tOrdinal0 [0x009988C3+821443]\n\tOrdinal0 [0x00947066+487526]\n\tOrdinal0 [0x00947393+488339]\n\tOrdinal0 [0x009474A3+488611]\n\tOrdinal0 [0x0099AA67+830055]\n\tOrdinal0 [0x00946DAF+486831]\n\tOrdinal0 [0x009513FE+529406]\n\tOrdinal0 [0x0095C57B+574843]\n\tOrdinal0 [0x0095C6CD+575181]\n\tOrdinal0 [0x0095B92B+571691]\n\tBaseThreadInitThunk [0x76158484+36]\n\tRtlValidSecurityDescriptor [0x77442FEA+282]\n\tRtlValidSecurityDescriptor [0x77442FBA+234]\n"}}

And in some cases it fails to return y.

and  we need a different case or additional steps for command 'rect' on wd_core.au3 -> _WD_ElementAction . 

$oJson = Json_Decode($sResponse)
$sX = Json_Get($oJson, "[value][x]")
$sY = Json_Get($oJson, "[value][Y]")
$sHeight = Json_Get($oJson, "[value][height]")
$sWidth = Json_Get($oJson, "[value][width]")

 

 

Edited by PoojaKrishna
Added parsing for 'rect' command.

Share this post


Link to post
Share on other sites

You may please use the following function for testing the 'rect'.  For the element's that returns an error, all elements of the resulting array is null.

; #FUNCTION# ====================================================================================================================
; Name ..........: _WD_ElementRect
; Description ...: Get rect of element
; Syntax ........: _WD_ElementRect($sSession, $sElement)
; Parameters ....: $sSession            - Session ID from _WDCreateSession
;                  $sElement            - Element ID from _WDFindElement
; Return values .: Success      - Returns a four-element array containing $aResult[0] = height, $aResult[1] = width, $aResult[2] = x, $aResult[3] = y
;                  Failure      - ""
;                  @ERROR       - $_WD_ERROR_Success
;                               - $_WD_ERROR_Exception
;                               - $_WD_ERROR_InvalidDataType
;                  @EXTENDED    - WinHTTP status code
; Author ........:
; Modified ......:
; Remarks .......:
; Related .......:
;                  https://w3c.github.io/webdriver/#get-element-rect
; Example .......: No
; ===============================================================================================================================
Func _WD_ElementRect($sSession, $sElement)
    Local Const $sFuncName = "_WD_ElementRect"
    Local $sResponse, $aResult[4] = [0], $iErr, $oJson
    $sResponse = __WD_Get($_WD_BASE_URL & ":" & $_WD_PORT & "/session/" & $sSession & "/element/" & $sElement & "/rect")
    $iErr = @error
    If $iErr = $_WD_ERROR_Success Then
        $oJson = Json_Decode($sResponse)
        $aResult[0] = Json_Get($oJson, "[value][height]")
        $aResult[1] = Json_Get($oJson, "[value][width]")
        $aResult[2] = Json_Get($oJson, "[value][x]")
        $aResult[3] = Json_Get($oJson, "[value][y]")
    EndIf
    If $_WD_DEBUG Then
        ConsoleWrite($sFuncName & ': ' & $sResponse & @CRLF)
    EndIf
    If $iErr Then
        Return SetError(__WD_Error($sFuncName, $_WD_ERROR_Exception, $sResponse), $_WD_HTTPRESULT, "")
    EndIf
    Return SetError($_WD_ERROR_Success, $_WD_HTTPRESULT, $aResult)
EndFunc   ;==>_WD_ElementRect

 

Share this post


Link to post
Share on other sites

change:

$sOption = '{"id":"' & $sIndexOrID & '"}'

Output:

__WD_Post: URL=HTTP://127.0.0.1:9515/session/546ab70e8c384f8afd93a2898d8993d6/element; $sData={"using":"xpath","value":"//*[@id="framecenter"]/div[2]/div[2]/iframe"}
__WD_Post: StatusCode=400; ResponseText=missing command parameters
_WD_FindElement: missing command parameters
_WD_FindElement ==> Webdriver Exception: HTTP status = 400
__WD_Post: URL=HTTP://127.0.0.1:9515/session/546ab70e8c384f8afd93a2898d8993d6/frame; $sData={"id":""}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such frame","message":"(Session infochrome=67.0.3396.99)","stacktrace":"Backtrace:\n\tOrdinal0 [0x009CDF70+778096]\n\tOrdinal0 [0x0097B42D+439341]\n\tOrdinal0 [0x00957E1D+294429]\n\tOrdinal0 [0x0095A2C1+303809]\n\tOrdinal0 [0x00940787+198535]\n\tOrdinal0 [0x00938349+164681]\n\tOrdinal0 [0x0093F96B+194923]\n\tOrdinal0 [0x0093824F+164431]\n\tOrdinal0 [0x00921B45+72517]\n\tOrdinal0 [0x00922F2A+77610]\n\tOrdinal0 [0x00922ECC+77516]\n\tGetHandleVerifier [0x00A69936+3478]\n\tOrdinal0 [0x009D88C3+821443]\n\tOrdinal0 [0x00987066+487526]\n\tOrdinal0 [0x00987393+488339]\n\tOrdinal0 [0x009874A3+488611]\n\tOrdinal0 [0x009DAA67+830055]\n\tOrdinal0 [0x00986DAF+486831]\n\tOrdinal0 [0x009913FE+529406]\n\tOrdinal0 [0x0099C57B+574843]\n\tOrdinal0 [0x0099C6CD+575181]\n\tOrdinal0 [0x0099B92B+571691]\n\tBaseThreadInitThunk [0x747062C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x77141EB9+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x77141E84+1028]\n"}}
_WD_Window: {"value":{"error":"no such frame","message":"(Session infochrome=67.0.3396.99)","stacktrace":"Backtrace:\n\tOrdinal0 [0x009CDF70+778096]\n\tOrdinal0 [0x0097B42D+439341]\n\tOrdinal0 [0x00957E1D+294429]\n\tOrdinal0 [0x0095A2C1+303809]\n\tOrdinal0 [0x00940787+198535]\n\tOrdinal0 [0x00938349+164681]\n\tOrdinal0 [0x0093F96B+194923]\n\tOrdinal0 [0x0093824F+164431]\n\tOrdinal0 [0x00921B45+72517]\n\tOrdinal0 [0x00922F2A+77610]\n\tOrdinal0 [0x00922ECC+77516]\n\tGetHandleVerifier [0x00A69936+3478]\n\tOrdinal0 [0x009D88C3+821443]\n\tOrdinal0 [0x00987066+487526]\n\tOrdinal0 [0x00987393+488339]\n\tOrdinal0 [0x009874A3+488611]\n\tOrdinal0 [0x009DAA67+830055]\n\tOrdinal0 [0x00986DAF+486831]\n\tOrdinal0 [0x009913FE+529406]\n\tOrdinal0 [0x0099C57B+574843]\n\tOrdinal0 [0x0099C6CD+575181]\n\tOrdinal0 [0x0099B92B+571691]\n\tBaseThreadInitThunk [0x747062C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x77141EB9+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x77141E84+1028]\n"}}

code is:

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@id="framecenter"]/div[2]/div[2]/iframe')
    $siFrame = _WD_FrameEnter($sSession, $sElement)
    Sleep(300)
    If $siFrame Then MsgBox(64,"",$siFrame)

This is my normal operation on the kantu plugin:

1.thumb.jpg.bcb4f67ace0f521aabb476673152bc6f.jpg

byname here that I should use?

selenium Class By.ByName

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Jgladden
      Dan - thanks for all that you do - this stuff is great. 
      Hoping you can assist with an issue we are having now that we have moved to Windows 10/Server 2016. The Chrome interactions were working flawlessly until moving over. Now my code fails when attempting to create the session. As you can see, our Chrome install is not in a standard location but I have validated the path to the binary. I have attached some detail below including system info, console output and the chrome log detail. I have tried several recommendations that have seen in various forums but none have made a difference
      Any assistance you can give would be greatly appreciated. 
      Thanks in advance, 
      chrome_Details.txt
    • 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/201106-webdriver-udf-help-support-ii/
    • By Langmeister
      I am once again asking for your experienced assistance. If I open a website that uses notifications I am asked to allow or block them for that website after a few seconds. This notification pops up every time the page gets navigated to, even tho you have clicked on allow for several times. I am explicitly not searching for smth to get rid of "Chrome is being controlled by automated test sw". Instead I am searching for a line of script to disable all notifications by default: like here chrome://settings/content/notifications. 
      This is code should give you an example of what notifications I am talking about:
      #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sID _WD_Option("Driver", "C:\Program Files (x86)\AutoIt3\chromedriver.exe") _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://webradio.planetradio.de/") _WD_LoadWait($sSession)  
    • By Langmeister
      Hi, I'm sure that this is a simple question regarding webdriver udf but my search on the forum did not result in the exact same scenario that I need. I will adapt it to my corporate needs but at first I want it to work with an example everybody can reproduce if needed.
      I navigate to https://www.daysoftheyear.com/ and want to find out what special day today is. Using the following Code returns the wanted text that today is 'shark awareness day' in the console but it is not pasted in notepad as it is not copied as it probably should be.
      #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sID _WD_Option("Driver", "C:\Program Files (x86)\AutoIt3\chromedriver.exe") _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.daysoftheyear.com/?timezone_offset=nan") _WD_LoadWait($sSession) Sleep(3000) Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/header/div/div[1]/div/div[2]/h3/a") _WD_ElementAction($sSession, $sElement, 'text') ClipGet() Run("notepad.exe") Sleep(500) Send("^v") Scite returns this, therefore the text has been found but the last mile to paste it to notepad or excel does not work for me.
      __WD_Get: URL=HTTP://127.0.0.1:9515/session/b72166b774d7fefb258b3721fc1d4306/element/657e6b5d-31a9-46a8-85c4-acb7f72bf659/text __WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"Shark Awareness Day"}... _WD_ElementAction: {"value":"Shark Awareness Day"}... Thanks in advance! 
       
    • By Langmeister
      Hi, I need help performing actions in Salesforce using IE. I used to complete tasks via MouseMove/MouseClick etc. on the Chrome application of SF, but unfortunately this only works for me and not my colleagues due to different positions of things etc. Being unable to get Webdriver UDF or Chromedriver running to interact with the code directly, I chose to look into the IE UDF. ATM I'm trying to tick a specific checkbox in SF which simply allows me to "select all checkboxes" at the same time. Applying the following code on a random website with checkboxes works just fine for me: (in this case selecting cheese checkbox)
      #include <IE.au3> Local $oIE = _IECreate("http://www.echoecho.com/htmlforms09.htm") Local $oSubmit = _IEGetObjByName($oIE, "option3") _IEAction($oSubmit, "click") _IELoadWait($oIE) But applying it to the Salesforce website it does exactly nothing and responds with these warnings/errors:
      The script is exactly the same, except for website and the input name tag of the desired checkbox being different.
      #include <IE.au3> Local $oIE = _IECreate("Corporate Salesforce URL") Local $oSubmit = _IEGetObjByName($oIE, "myPage:myForm:oliListBlock:oliListTable:j_id36") _IEAction($oSubmit, "click") _IELoadWait($oIE) As its working with random websites my guess is that there has to be something done to get it work with SF.
      Hope the more experienced SF+AutoIt pros can help me out here. Thanks in advance!
×
×
  • Create New...