Jump to content

eesirrius

Members
  • Posts

    8
  • Joined

  • Last visited

eesirrius's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks for your help. I have been able to run the main but was getting an error with _ConfirmConsentDialog(). There might have been a dialog on the test page initially. I commented out that part and the script is now running correctly. Thank you very much for the library.
  2. 1) As far as I can see, you want to login to the page by email, password and submit, right? Thas is exactly it to start 2) I have no preference
  3. Consol >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" /ErrorStdOut "C:\Program Files (x86)\AutoIt3\SciTE\autoit-webdriver-boilerplate-main\src\website-steps-handler.au3" >Exit code: 0
  4. yeah 2 days old apprentice 😁 I installed everyting. i am running this but nothing happens: #include-once #include ".\init.au3" Func _Steps() _OpenWebsite() _ConfirmConsentDialog() _NavigateBetweenPages() _GetTableTexts() _Print('Automation steps completed!') Sleep(1500) EndFunc Func _OpenWebsite() _NavigateTo('https://www.w3schools.com/xml/xpath_intro.asp') EndFunc
  5. I tried both but it is the jjcandy one. I added the correct code in the post and deleted the cod efile that is not working
  6. I have been trying to select a field in a page in order to insert a value. I have tried so many tings but am not able to find the elemet on the page. The element is there I can see it. once the page is loaded. I have tried Sleep for 10 seconds, Load wait and every suggestion chat GPt could offer. I have to mention that I have played with the files because I was getting errors in relation to function used in wd-core.au3 so I had to change some function names and all. It could be that me chrome driver is not in synch with the included file versions. As of now. I am getting the error ""Could not find the search button" #include "JSON.au3" #include "WinHttp.au3" #include "wd_core.au3" #include "wd_helper.au3" #include "wd_capabilities.au3" ; Setup ChromeDriver Global $_WD_DRIVER = "C:\Tools\ChromeDriver\chromedriver.exe" Global $_WD_PORT = 9515 Global $_WD_DRIVER_PARAMS = "--port=9515" ; Start WebDriver _WD_Startup() ; === Set Capabilities === Local $sCaps = '{"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{"args":["--start-maximized"]}}}}' _WD_Option('Capabilities', $sCaps) ; Create Session Local $sSession = _WD_CreateSession() If @error Then MsgBox(16, "Error", "Failed to create session.") Exit EndIf ; Navigate to website _WD_Navigate($sSession, "https://distributionjjcandy.com/account/login") ;Local $sSource = _WD_GetSource($sSession) ;ConsoleWrite($sSource & @CRLF) ;_WD_LoadWait($sSession) ; wait for page to load Sleep(3000) Local $jsCode = "return (function() {" & _ "var el = document.querySelector('#input--template--22102333292843__main--customeremail');" & _ "if(el) {return (el.offsetWidth > 0 && el.offsetHeight > 0);} else {return false;}" & _ "})()" Local $result = _WD_ExecuteScript($sSession, $jsCode) ConsoleWrite("Visible? " & $result & @CRLF) ; Find and click the search button (by CSS selector) Local $sElement = _WD_FindElement($sSession, "xpath", "//input[@type='email']") ;Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByLinkText, "Login") ;_WD_WaitElement($sSession, $_WD_LOCATOR_ByCSSSelector, "a[href='/https/www.autoitscript.com/account/login']", 10000) ;_WD_ElementAction($sSession, $sElement, 'focus') _WD_SetElementValue($sSession, $sElement, "[email protected]") Sleep(1000) If StringStripWS($sElement, 3) = "" Or StringLower($sElement) = "null" Or StringInStr($sElement, "error") Then MsgBox(16, "Error", "Could not find the search button.") Else _WD_ElementAction($sSession, $sElement, 'click') EndIf ;Local $sJS = "document.querySelector(""a[href='/https/www.autoitscript.com/account/login']"").click();" ;Local $sResult = _WD_ExecuteScript($sSession, $sJS, "[]") ;ConsoleWrite("JavaScript click result: " & $sResult & @CRLF) Sleep(3000) ; Close everything ;_WD_DeleteSession($sSession) ;_WD_Shutdown() ConcoleOutput..A.txt JSON.au3 WinHttp.au3 wd_core.au3 wd_helper.au3 wd_capabilities.au3
  7. When I copy the code for some reason I get the error that $oWorkbook needs to be an object Local $oWorkbook = _Excel_BookAttach($var) $oWorkbook.WorkSheets("Sheet2").Activate in A previous part of my code I am using the same variable to open the work sheet $oExcel = _Excel_BookOpen(_Excel_Open(),$var)
×
×
  • Create New...