Jump to content

corvo

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by corvo

  1. Thank you so much, it started working now after removing the extra unnecessary lines - But now it only works in case no Chrome windows were open when I run the script, otherwise, it will start a new window, without navigating to the link. And when I remove the user profile tags from the capabilities, it starts working again (even if I've previously opened Chrome tabs). Here is the updated code: #include "wd_helper.au3" #include "wd_capabilities.au3" #include "wd_core.au3" SetupChrome() local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Profile 2"]}}}}' $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.google.com") Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_Option('DriverParams', '--marionette-port 2828') ;~ $_WD_DEBUG = $_WD_DEBUG_None ; EndFunc Error Log (in case a Chrome window was already open). _WD_Option ==> Success [0] : Parameters: Option=Driver Value=chromedriver.exe _WD_Option ==> Success [0] : Parameters: Option=Port Value=9515 _WD_Option ==> Success [0] : Parameters: Option=DriverParams Value=--verbose --log-path="C:\Users\mm\autoit\SciTe\chrome.log" _WD_Option ==> Success [0] : Parameters: Option=DriverParams Value=--marionette-port 2828 __WD_Post ==> Webdriver Exception [10] : HTTP status = 500 _WD_CreateSession ==> Webdriver Exception [10] __WD_Post ==> Invalid session ID [15] : HTTP status = 404 _WD_Navigate ==> Invalid session ID [15] : Parameters: URL=https://www.google.com Thank you for all the help!
  2. Hello! I've been trying to launch chrome through WD, but for some reason, the user profile is not working, it just opens up the chrome window with the "temp" user. I've also made sure that the user profile path is correct by using "chrome://version". Here is what I've got so far: #include "wd_helper.au3" #include "wd_capabilities.au3" #include "wd_core.au3" SetupChrome() _WD_CapabilitiesStartup() Local $sCapabilities = _WD_CapabilitiesGet() $sSession = _WD_CreateSession($sCapabilities) _WD_Navigate($sSession, "https://www.google.com") Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_Option('DriverParams', '--marionette-port 2828') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Profile 2"]}}}}' $_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error EndFunc Thanks in advance!
  3. Hi, I'm trying to populate a 2D array from text file contents. the text file has multi-lines/rows, and the word "chat" comes at the end of each line, which I've used as a split character to split rows. Now I'm struggling in column splitting, as I'm trying to split columns by spaces (which are already available in the text file) and can be seen in below data sample. here is what I've reached so far #include <File.au3> #include <Array.au3> $file = "c:\test\data.txt" local $arr = stringsplit(fileread($file),"chat",3) $arr2 = stringsplit($arr[0]," ",3) _ArrayTranspose($arr2) _ArrayDisplay($arr2) It gives me the result I'm looking for, but for one line only. Tried For Loop, but it still gives me the data for last row only. below is a sample of the text data. 950-138742 System TestQ@DefaultTenant 555555555:Default Question Guest va12 00:00:01 No 01/13/2021 19:59:36 Active chat 950-138741 System TestQV@DefaultTenant 222222222:Default Question Guest tmagalaa 00:00:03 No 01/13/2021 19:59:33 Inactive chat 950-138740 System TestQV2@DefaultTenant 111111111:Default Question Guest esabdelghany 00:00:03 No 01/13/2021 19:59:28 Inactive chat 950-138739 System TestWQA@DefaultTenant 000000000:Default Question Guest saelgabry 00:00:01 No 01/13/2021 19:59:26 Active chat and here is what my output looks like (which I need to apply on all rows).
  4. Hi there.. I'm trying to click a TD cell inside a table that has been created to simualte a date picker calendar. The page has two of these date pickers, One for starting date and the other is for the ending date. I just want the starting date to be always set to 1. I tried the below but it didn't work. #include <IE.au3> #include <MsgBoxConstants.au3> $oIEmain = _IECreate("the webpage") _IELinkClickByText($oIEmain,'the link that leads to the calendar page') _IELoadWait($oIEmain) $oTDs = _IETagnameGetCollection($oIEmain, "TD") For $oTD in $oTDs If String(_IEPropertyGet($oTD, "innertext")) = "1" Then _IEAction($oTD, "click") ExitLoop EndIf Next Attached is a photo of the code from inspect screen. we only have the "value" in hand, as the ID is dynamically changing when the page is refreshed.
×
×
  • Create New...