Jump to content

ungovernable

Members
  • Posts

    9
  • Joined

  • Last visited

ungovernable's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I have another question... What's wrong with my XPath? $spod_image_size_element = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//g[@class='configuration-info']/text") $spod_image_size = _WD_ElementAction($sSession, $spod_image_size_element, 'property', 'value') here's the element in dev console: the <text> element shows up dynamically, it appears only when I hold the mouse button over the image to resize it. So I try to catch it in a loop: while 1 sleep(5000) $spod_image_size_element = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//g[@class='configuration-info']") $spod_image_size = _WD_ElementAction($sSession, $spod_image_size_element, 'property', 'value') msgbox(0,"Element text = " & $spod_image_size, "") WEnd I also tried to get the parent element instead (g.configuration-info) but still can't be found: this doesn't work either: //g[contains(@class, 'configuration-info')]
  2. Is there a way to save cookies with WebDriver so I don't have to re-login every time I restart my script?
  3. lol omg how did I miss this, should have been obvious 🤦‍♂️😅 it's working now... thank you!
  4. Yes I tried without the timeouts, I added it because I googled the error and it was suggested in another thread to add timeouts to $sDesiredCapabilities Just reverted it back to the code you posted and I got the same error
  5. I just updated WinHttp.au3 but I get the same error Thanks for the fast answers 👍
  6. I didn't find the solution so I ended up using just the gecko driver. However i'm facing another problem now. I'm not able to click the button, I always get this error: Here's my code: #include "wd_core.au3" #include "wd_helper.au3" #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Local $sDesiredCapabilities, $iIndex, $sSession Local $nMsg, $bProcess = False SetupGecko() _WD_Startup() $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true,"timeouts": {"implicit": 0, "pageLoad": 60000, "script": 30000}}}' $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://app.spod.com/global") ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF) _WD_Shutdown() Func SetupGecko() _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) EndFunc WinWait("Sign-in to your account | SPOD App", "") Sleep(5000) ConsoleWrite("........................." & @CRLF) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@id='onetrust-accept-btn-handler']") _WD_ElementAction($sSession, $sElement, "click") exit;
  7. Where can I find a working example of automating Chrome browser with autoit? I tried various examples found on this forum but I can't get it to work... I tested both "chrome_example.auto3" and "chrome_example_2.auto3" from this thread. Of course I made sure to follow the instructions and install the pre-requisites. From this thread: But when I launch the au3 script, it opens the page in the browser then it just hangs there. It doesn't fill any form element or click any link. I'm afraid I'll get an answer saying "not working" is too vague, but I can't find any information as to why it's not working. It's not writing anything to the console and there is no error message. I noticed the examples I used are from 2013 so maybe it's outdated. Is there a more recent version of those 2 examples files ? I also tested with the most recent example from this page: https://www.autoitscript.com/wiki/WebDriver I followed the instructions but as soon as I open wd_demo.au3 and click the button to run DemoNavigation in Chrome, it doesn't work. The script opens the browser then instantly closes it. I also tried using Edge Driver instead, but the browser window instantly closes again However, if I test with gecko driver (Firefox) then the demo works correctly. Why isn't it working for Chrome and Edge?
  8. i'm recording a script to autofill a wordpress form where i need to enter the string {{original_post_url}} However, imacros think i am trying to send a built-in variable to it ends up writing __undefined__ to wordpress How can i send {{original_post_url}} as a string ? I already tryed escaping it with backslashes but it doesnt work \{\{original_post_url\}\} Edit: sorry for previous double post, i submitted this one only once
×
×
  • Create New...