Jump to content

WebDriver UDF - Help & Support (III)


Danp2
 Share

Recommended Posts

@Danp2

Quote

On initial glance, this is where I think your issue resides. Whatever element is being found is the wrong one because you aren't using the correct xpath. If you want to use a variable to store a portion of the xpath, then you need to concatenate it to the rest of your xpath string --

Thanks for your reply. I saw that I make a coding mistake here.

Originally, I put the search string into the xpath, but AutoIt log said that the element cannot be found, and the log show the string as "???????" which make me think that it cannot handle Japanese characters.

The original code is as below:

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//td[contains(text(),'入庫データ取込エラー対応')]")

 

Link to comment
Share on other sites

@Danp2

Quote

Please post the full results from the Scite output panel so that we can see what's going on. Also, have you tried directing the click at the parent TR element instead?

I will send you the log on Monday, when I am back to my office.

As for calling <tr>, how should I call it?

Like this?

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr//td[contains(text(),'入庫データ取込エラー対応')]")

Sorry for many question. I have just begin learning this tool.

Link to comment
Share on other sites

@ProspektThere are ways to traverse up and down the DOM using xpath. To retrieve the parent TR element, you should be able to do this --

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//td[contains(text(),'入庫データ取込エラー対応')]/parent::node()")

There are additional ways to achieve the same result. Here's another option --

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr[./td[contains(text(),'入庫データ取込エラー対応')]]")

 

Link to comment
Share on other sites

Hey I am new to wd and I have the problem with changing an inout value.

The Website does automatically preset a value. So if I use:

_WD_ElementAction($sSession, $Systeminput, 'value', $i )

it just adds $i behind the existing value instead of  replaxing it. So what I have tried is to use Send("Backspace") to delet text but it doesnt work :D so i tried it with 

_WD_ElementAction($sSession, $sElement, 'value', "\uE003")

but here it just added "\uE003" as text into the next input the is right placed of the input i want to change .

 

So This is what i have (shorten):

#include "wd_core.au3"
#include "wd_helper.au3"
Local $sDesiredCapabilities, $sSession
SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "Website...")

$logfile = ".\Logger.log"
$logiconent = FileReadLine($logfile, 1)
$i = $logiconent;zuletztgewesene StandardSystem

HotKeySet("{NumPad2}", "DoSth")

While 1
    Sleep(50)
WEnd
 
Func DoSth()
   $Systeminput = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='input-id']")
   _WD_ElementAction($sSession, $Systeminput, 'value', $i )
   sleep(100)
   _WD_ExecuteScript($sSession, "jQuery('#confirmbutton').click()")

EndFunc
 
 _WD_Shutdown()
 Func SetupChrome()
    _WD_Option('Driver', 'chromedriver.exe')
    _WD_Option('Port', 9515)
    _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"')

    $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}'
 EndFunc   ;==>SetupChrome
 Func SetupGecko()
    _WD_Option('Driver', 'geckodriver.exe')
    _WD_Option('DriverParams', '--log trace')
    _WD_Option('Port', 4444)

    $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'
EndFunc   ;==>SetupGecko

 

I hope you can help me out :)

again summary: How to replace input value

Link to comment
Share on other sites

And OneSolution mentioned 2019 that he was able to use a code that was kind of this:

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[contains(text(),'Save')]")
    _WD_ElementAction($sSession, $sElement, 'click')

But when i use it it does nothing. Do I have to include something more to use it ?

Link to comment
Share on other sites

Well i think i did use it wrong it does nothing ^^

I am sry I have no experiences

Func ZuKartenAnsicht()
   _WD_ExecuteScript($sSession, "jQuery('.heMenuIconsSmall_map').click()")
    sleep(2000)
   $Systeminput = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='galaxy-load-id']")
   $sAction = '{"actions":[{"type": "key", "id": "galaxy-load-id", "actions": [{"type": "keyDown", "value": "\uE003"}, {"type": "keyUp", "value": "\uE003"}]}]}'
   _WD_Action($sSession,"actions", $sAction)
   _WD_ElementAction($sSession, $Systeminput, 'value', $i )
   sleep(100)
   _WD_ExecuteScript($sSession, "jQuery('#galaxy-load-outer').click()")

EndFunc

Here this is the input html:

image.png.1b7c78477ccfc0b56e522dbbb743c04c.png

Link to comment
Share on other sites

@MuddyblackWe won't be able to assist you since your request violates the forum rules, specifically --

Quote

Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects:

 Launching, automation or script interaction with games or game servers, regardless of the game.

 

Link to comment
Share on other sites

@Danp2

On 6/5/2021 at 8:33 PM, Danp2 said:

There are ways to traverse up and down the DOM using xpath. To retrieve the parent TR element, you should be able to do this --

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//td[contains(text(),'入庫データ取込エラー対応')]/parent::node()")

There are additional ways to achieve the same result. Here's another option --

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr[./td[contains(text(),'入庫データ取込エラー対応')]]")

 

This is the result of each solution:

1.

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//td[contains(text(),'入庫データ取込エラー対応')]")
--- LOG ---------------------------------------------------------------------------------------------------------------------
__WD_Post: URL=HTTP://127.0.0.1:9515/session/badd19b39aab0017f9d79937334ceee6/element; $sData={"using":"xpath","value":"//td[contains(text(),'????????????')]"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404

2.

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//td[contains(text(),'入庫データ取込エラー対応')]/parent::node()")
--- LOG ---------------------------------------------------------------------------------------------------------------------
__WD_Post: URL=HTTP://127.0.0.1:9515/session/d20ea4336005d0fcd5de98ae6cb4f931/element; $sData={"using":"xpath","value":"//td[contains(text(),'????????????')]/parent::node()"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]/parent::node()\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]/parent::node()\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404

3.

$sRowTask = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr[./td[contains(text(),'入庫データ取込エラー対応')]]")
--- LOG ------------------------------------------------------------------------------------------------------------
__WD_Post: URL=HTTP://127.0.0.1:9515/session/ba61e06177536aefcf6f920c9dbba470/element; $sData={"using":"xpath","value":"//tr[./td[contains(text(),'????????????')]]"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//tr[./td[contains(text(),'????????????')]]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//tr[./td[contains(text(),'????????????')]]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404

I also try using variable, but the result is the same

Const $vTask = '入庫データ取込エラー対応'
$sRowTask1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//td[contains(text(),'" & $vTask & "')]")
$sRowTask2 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//td[contains(text(),'" & $vTask & "')]/parent::node()")
$sRowTask3 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//tr[./td[contains(text(),'" & $vTask & "')]]")
--- LOG ----------------------------------------------------------------------------------------------------------------
__WD_Post: URL=HTTP://127.0.0.1:9515/session/8c59572455ccb548647c5c9603854bd2/element; $sData={"using":"xpath","value":"//td[contains(text(),'????????????')]"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
-----------------------------------------------------------------------------------------------------------------------------------
__WD_Post: URL=HTTP://127.0.0.1:9515/session/8c59572455ccb548647c5c9603854bd2/element; $sData={"using":"xpath","value":"//td[contains(text(),'????????????')]/parent::node()"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]/parent::node()\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//td[contains(text(),'????????????')]/parent::node()\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
-----------------------------------------------------------------------------------------------------------------------------------
__WD_Post: URL=HTTP://127.0.0.1:9515/session/8c59572455ccb548647c5c9603854bd2/element; $sData={"using":"xpath","value":"//tr[./td[contains(text(),'????????????')]]"}
__WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\...
__WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//tr[./td[contains(text(),'????????????')]]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//tr[./td[contains(text(),'????????????')]]\"}\n  (Session info: chrome=91.0.4472.77)","stacktrace":"Backtrace:\n\tOrdinal0 [0x006D2DB3+2502067]\n\tOrdinal0 [0x0066C5B1+2082225]\n\tOrdinal0 [0x00572498+1057944]\n\tOrdinal0 [0x0059CD5B+1232219]\n\tOrdinal0 [0x005C6792+1402770]\n\tOrdinal0 [0x005B5D5A+1334618]\n\tOrdinal0 [0x005C4B7B+1395579]\n\tOrdinal0 [0x005B5BEB+1334251]\n\tOrdinal0 [0x00592174+1188212]\n\tOrdinal0 [0x00593009+1191945]\n\tGetHandleVerifier [0x0084EC5C+1511084]\n\tGetHandleVerifier [0x008F8522+2205554]\n\tGetHandleVerifier [0x00753393+480739]\n\tGetHandleVerifier [0x00752579+477129]\n\tOrdinal0 [0x00671E5D+2104925]\n\tOrdinal0 [0x006763F8+2122744]\n\tOrdinal0 [0x00676537+2123063]\n\tOrdinal0 [0x0067EE53+2158163]\n\tBaseThreadInitThunk [0x770EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x777D7A6E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404

I wonder if AutoIt cannot handle Japanese Unicode character, so I chnage the string to 'DemoTableWidget', but the serult is the same.

 

 

Link to comment
Share on other sites

Hey,

I have a problem with automatic log in to google services. I have an error like in screenshot.

image.png.65655238d43d22f3b952c8c74b372eb0.png

Code looks fine. I am using it with Twitter and few other services but I stuck on Google 😕

 

Func SetupChrome()
_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}'
EndFunc

 

chrome.log

Edited by Wo0ki3
Link to comment
Share on other sites

Hello,
it's me again. I'm still trying to control a web based visualization with AutoIt. I have put a small visualization on the internet, so anybody who finds the time could take a look and hopefully give me some advice how to control this visualization with AutoIt by directly addressing the controls and not via mouse move/click commands. The URL to this visualization is http://ist.tobit.net/Tc3PlcHmiWeb/Port_851/Visu/webvisu.htm
The visualization contains different elements. The buttons switches the lamps below them on and off. The buttons should be pressed via AutoIt and it should be detected, if the LED lights up or not. The sliders are used to set a value which is displayed in a field behind the label "Value". At the moment I don't need to control sliders, but if anybody has an idea how to do it, it would be great if you tell me how. I have added the slider only to vary the displayed value. The field labeled Input is an input field in which a value from 0 to 255 could be entered. The choice of the radio button is also displayed below of it in the field labeled value. The last element is a drop down menu.
The reason why the elements exists more then once is, because in TwinCAT 3 (The software with which this was created) allows to use subvisualizations which might act differently then if the elements are placed directly on the visualization.

Edited by OliverTonn
Link to comment
Share on other sites

1 hour ago, OliverTonn said:

it's me again. I'm still trying to control a web based visualization with AutoIt. I have put a small visualization on the internet, so anybody who finds the time could take a look and hopefully give me some advice how to control this visualization with AutoIt by directly addressing the controls and not via mouse move/click commands.

The short answer is "you can't". You can use Webdriver to automate the website, but you will still need to use coordinates to control where the click occurs. For lots of detailed discussions, try googling "webdriver canvas html5".

 

Link to comment
Share on other sites

@Danp2Thanks for your UDF.
I'm just getting started with it.
And I have a few suggestions.
1. Extend UDF with verify functions. At least the most common ones.
Examples can be found in the plugin and description.
2. Think about making a spy as the Au3Info and on mouse hover showing xpath (full and relative), css selector and other parameters that I have not thought about yet.

Thanks and good luck.

1.png.a4f94e6aa270b409963db85d0e8ef403.png

Link to comment
Share on other sites

  • Danp2 changed the title to WebDriver UDF (W3C compliant version) - 07/29/2022
  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...