
ngocthang26
Active Members-
Posts
20 -
Joined
-
Last visited
Everything posted by ngocthang26
-
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Yes sorry all. I will provide more infomation -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
<input class="_58al _2gnb" type="text" aria-invalid="false" aria-labelledby="js_1b" placeholder="Enter a name..." value="" xpath="1"> When I use this code _WD_WaitElement($sSession,$_WD_LOCATOR_ByXPath,"//input[@class='_58al _2gnb']") $sElement = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//input[@class='_58al _2gnb']") _WD_ElementAction($sSession, $sElement, 'value',"test") Don't set value But i try code js document.getElementsByClassName("_58al _2gnb")[1].value="dasd"; Can I identify false xpath. How do click element with class have [0] [1] [2] . I try change postion //input[@class='_58al _2gnb'[0]], //input[@class='_58al _2gnb\[0]'], //input[@class='_58al _2gnb[0]']. Anything fales __WD_Post: URL=HTTP://127.0.0.1:9515/session/9a5b499e43e9ce859743d05f1739dd70/element; $sData={"using":"xpath","value":"//input[@class='_58al _2gnb'][0]"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"xpath\",\"selector\"\"//input[@class='_58al _2gnb'][0]\"}(Session infochrome=83.0.4103.61)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C03CF0+867568]\n\tOrdinal0 [0x00BADB7D+514941]\n\tOrdinal0 [0x00B7B367+308071]\n\tOrdinal0 [0x00B49425+103461]\n\tOrdinal0 [0x00B63B70+211824]\n\tOrdinal0 [0x00B5AEC0+175808]\n\tOrdinal0 [0x00B6278D+206733]\n\tOrdinal0 [0x00B5AD2B+175403]\n\tOrdinal0 [0x00B43740+79680]\n\tOrdinal0 [0x00B44CFC+85244]\n\tOrdinal0 [0x00B44C50+85072]\n\tOrdinal0 [0x00C0E62A+910890]\n\tOrdinal0 [0x00BB8993+559507]\n\tOrdinal0 [0x00BB8BA3+560035]\n\tOrdinal0 [0x00BB8C8C+560268]\n\tOrdinal0 [0x00C11907+923911]\n\tOrdinal0 [0x00BB87FF+559103]\n\tOrdinal0 [0x00BC306E+602222]\n\tOrdinal0 [0x00BCEA3B+649787]\n\tOrdinal0 [0x00BCEBA5+650149]\n\tOrdinal0 [0x00BCDDA5+646565]\n\tBaseThreadInitThunk [0x751560C9+25]\n\tRtlGetAppContainerNamedObjectPath [0x771B7A94+228]\n\tRtlGetAppContainerNamedObjectPath [0x771B7A64+180]\n"}} _WD_FindElement: {"value":{"error":"no such element","message":"Unable to locate element{\"method\"\"xpath\",\"selector\"\"//input[@class='_58al _2gnb'][0]\"}(Session infochrome=83.0.4103.61)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00C03CF0+867568]\n\tOrdinal0 [0x00BADB7D+514941]\n\tOrdinal0 [0x00B7B367+308071]\n\tOrdinal0 [0x00B49425+103461]\n\tOrdinal0 [0x00B63B70+211824]\n\tOrdinal0 [0x00B5AEC0+175808]\n\tOrdinal0 [0x00B6278D+206733]\n\tOrdinal0 [0x00B5AD2B+175403]\n\tOrdinal0 [0x00B43740+79680]\n\tOrdinal0 [0x00B44CFC+85244]\n\tOrdinal0 [0x00B44C50+85072]\n\tOrdinal0 [0x00C0E62A+910890]\n\tOrdinal0 [0x00BB8993+559507]\n\tOrdinal0 [0x00BB8BA3+560035]\n\tOrdinal0 [0x00BB8C8C+560268]\n\tOrdinal0 [0x00C11907+923911]\n\tOrdinal0 [0x00BB87FF+559103]\n\tOrdinal0 [0x00BC306E+602222]\n\tOrdinal0 [0x00BCEA3B+649787]\n\tOrdinal0 [0x00BCEBA5+650149]\n\tOrdinal0 [0x00BCDDA5+646565]\n\tBaseThreadInitThunk [0x751560C9+25]\n\tRtlGetAppContainerNamedObjectPath [0x771B7A94+228]\n\tRtlGetAppContainerNamedObjectPath [0x771B7A64+180]\n"}} _WD_FindElement ==> No match: HTTP status = 404 _WD_WaitElement ==> Timeout Thanks you so much -
Help conver string from Uni to Character
ngocthang26 replied to ngocthang26's topic in AutoIt General Help and Support
Working. Thanks you so much. ❤️ -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Hi Danp2 I have problem replace new udf _WD_Navigate($sSession, "https://r12a.github.io/app-conversion/") _WD_WaitElement($sSession,$_WD_LOCATOR_ByXPath,"//textarea[@id='escapedInput']") $sElement = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//textarea[@id='escapedInput']") _WD_ElementAction($sSession, $sElement, 'value', "Allosl woaks") This my code work old udf V0.1.0.15 When I try download new udf then code don't set value. Can you suggest help me. Thanks -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Hi I have problem click element <input class="RNmpXc" value="I'm can see" aria-label="I'm can see" type="submit" jsaction="sf.lck" data-ved="0ahUKEwjy2M_suMzpAhWYH3AKHVRCB-sQ19QECAw"> When I try with code click Class ="RNmpXc" but don't any action. _WD_WaitElement($sSession,$_WD_LOCATOR_ByXPath,"//input[@class='RNmpXc']") $sElement = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//input[@class='RNmpXc']") _WD_ElementAction($sSession, $sElement, 'click') I try code JS then working. But I need use WaitElement wait element show. _WD_ExecuteScript($sSession, "document.getElementsByClassName('RNmpXc')[0].click();") Thanks -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Thanks you so much. p/s: cam on bac nhieu -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
I have a problem when shutdown browser with function _WD_Shutdown no working ( Chromedriver don't close ). I use chromedriver 80. I try other PC but same error. Code for wd_demo #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.facebook.com") _ChromeSetInputValueById($sSession,'email','abc') _ChromeSetInputValueById($sSession,'pass','xyz') _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args":[' & """start-maximized""," & " ""disable-infobars""" & "" & '] }}}}' EndFunc ;==>SetupChrome Func _ChromeSetInputValueById($sSession,$Id,$Value) $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']") _WD_ElementAction($sSession,$sButton,'value', $Value) EndFunc Log >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\ngoct\Desktop\New folder\wd_demo.au3" _WDStartup: OS: WIN_10 WIN32_NT 18362 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.1.0.15 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --log-path="C:\Users\ngoct\Desktop\New folder\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args":["start-maximized", "disable-infobars"] }}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a)","userDataDir":"C:\\Users\\ngoct\\AppData\\Local\\Temp\\scoped_dir11160_16333"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:52928"},"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,"unhandledPromptBehavior":"","version":"80.0.3987.122","webStorageEnabled":true},"sessionId":"f4562a56f017819c4986725f6293074c"}} _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a)","userDataDir":"C:\\Users\\ngoct\\AppData\\Local\\Temp\\scoped_dir11160_16333"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:52928"},"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,"unhandledPromptBehavior":"","version":"80.0.3987.122","webStorageEnabled":true},"sessionId":"f4562a56f017819c4986725f6293074c"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/f4562a56f017819c4986725f6293074c/url; $sData={"url":"https://www.facebook.com"} __WD_Post: StatusCode=200; ResponseText={"value":null} _WD_Navigate: {"value":null} __WD_Post: URL=HTTP://127.0.0.1:9515/session/f4562a56f017819c4986725f6293074c/element; $sData={"using":"xpath","value":"//input[@id='email']"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"dcbc9b26-aa3d-423c-a046-3e07eba5a3b1"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"dcbc9b26-aa3d-423c-a046-3e07eba5a3b1"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/f4562a56f017819c4986725f6293074c/element/dcbc9b26-aa3d-423c-a046-3e07eba5a3b1/value; $sData={"id":"dcbc9b26-aa3d-423c-a046-3e07eba5a3b1", "text":"abc", "value":["a","b","c"]} __WD_Post: StatusCode=200; ResponseText={"value":null} _WD_ElementAction: {"value":null} __WD_Post: URL=HTTP://127.0.0.1:9515/session/f4562a56f017819c4986725f6293074c/element; $sData={"using":"xpath","value":"//input[@id='pass']"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"00e3a503-4311-4440-92ae-dd3c8ef3f3ac"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"00e3a503-4311-4440-92ae-dd3c8ef3f3ac"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/f4562a56f017819c4986725f6293074c/element/00e3a503-4311-4440-92ae-dd3c8ef3f3ac/value; $sData={"id":"00e3a503-4311-4440-92ae-dd3c8ef3f3ac", "text":"xyz", "value":["x","y","z"]} __WD_Post: StatusCode=200; ResponseText={"value":null} _WD_ElementAction: {"value":null} >Exit code: 0 Time: 16.93 How do fix. Thanks anyone -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
_WDStartup: OS: WIN_7 WIN32_NT 7601 Service Pack 1 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.1.0.15 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --log-path="C:\Users\Administrator\Desktop\Project test\View youtube proxy\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities":{"alwaysMatch":{"unhandledPromptBehavior":"ignore","proxy":{"proxyType":"manual","httpProxy":"123.31.45.40:1808","ftpProxy":"123.31.45.40:1808","sslProxy":"123.31.45.40:1808","socksUsername":"ngocthang456789","socksPassword":"ngocthang456789","autodetect":"true"},"goog:chromeOptions":{"w3c":true,"excludeSwitches":["enable-automation"],"useAutomationExtension":false,"prefs":{"credentials_enable_service":false},"args":["start-maximized"]}}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a)","userDataDir":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\scoped_dir4776_5026"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:60015"},"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,"unhandledPromptBehavior":"ignore","version":"79.0.3945.117","webStorageEnabled":true},"sessionId":"58156972e776e22985d9a88fb134c51e"}} _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"acceptSslCerts":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a)","userDataDir":"C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\scoped_dir4776_5026"},"cssSelectorsEnabled":true,"databaseEnabled":false,"goog:chromeOptions":{"debuggerAddress":"localhost:60015"},"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,"unhandledPromptBehavior":"ignore","version":"79.0.3945.117","webStorageEnabled":true},"sessionId":"58156972e776e22985d9a88fb134c51e"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/58156972e776e22985d9a88fb134c51e/url; $sData={"url":"https://whatismyipaddress.com/"} __WD_Post: StatusCode=200; ResponseText={"value":null} _WD_Navigate: {"value":null} It my debug log. but problem Sign In Alerts require type User & Pass. I have set SocketUser and SocketPassword in $sDesiredCapabilities but don't effective. Thanks -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Hi Danp2, you have problem set proxy for chromedriver. If proxy no user:pass. Code is working. But proxy has user:pass have error alert. Proxy JSON Object A JSON object describing a Proxy configuration. Key Type Description proxyType string (Required) The type of proxy being used. Possible values are: direct - A direct connection - no proxy in use, manual - Manual proxy settings configured, e.g. setting a proxy for HTTP, a proxy for FTP, etc, pac - Proxy autoconfiguration from a URL, autodetect - Proxy autodetection, probably with WPAD, system - Use system settings proxyAutoconfigUrl string (Required if proxyType == pac, Ignored otherwise) Specifies the URL to be used for proxy autoconfiguration. Expected format example: http://hostname.com:1234/pacfile ftpProxy, httpProxy, sslProxy, socksProxy string (Optional, Ignored if proxyType != manual) Specifies the proxies to be used for FTP, HTTP, HTTPS and SOCKS requests respectively. Behaviour is undefined if a request is made, where the proxy for the particular protocol is undefined, if proxyType is manual. Expected format example: hostname.com:1234 socksUsername string (Optional, Ignored if proxyType != manual and socksProxy is not set) Specifies SOCKS proxy username. socksPassword string (Optional, Ignored if proxyType != manual and socksProxy is not set) Specifies SOCKS proxy password. noProxy string (Optional, Ignored if proxyType != manual) Specifies proxy bypass addresses. Format is driver specific. I find doc from this website but try my code until don't working. i try _WD_Alert but return False or don't send text. You can suggest help me how use proxy have user:pass. Thanks so much #include "wd_core.au3" #include "wd_helper.au3" Local $sSession Local $sDesiredCapabilities SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) ;~ _WD_Navigate($sSession, "https://whatismyipaddress.com/") ;~ Sleep(2000) Sleep(3000) Global $Handle = _WD_Alert($sSession, 'status') MsgBox("","",$Handle,100) Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities":{"alwaysMatch":{"unhandledPromptBehavior":"ignore","proxy":{"proxyType":"manual","httpProxy":"123.31.45.40:1808","ftpProxy":"123.31.45.40:1808","sslProxy":"123.31.45.40:1808","socksUsername":"ngocthang456789","socksPassword":"ngocthang456789","autodetect":"true"},"goog:chromeOptions":{"w3c":true,"excludeSwitches":["enable-automation"],"useAutomationExtension":false,"prefs":{"credentials_enable_service":false},"args":["start-maximized"]}}}}' $sDesiredCapabilities EndFunc -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
thanks, working.. P/s: I use -headless hide browser but so slow code. I try suggest in google search but don't improve. You can other method hide browser ? const chromeOptions = new chrome.Options();//.headless(); chromeOptions.addArguments("--headless"); chromeOptions.addArguments("--proxy-server='direct://'"); chromeOptions.addArguments("--proxy-bypass-list=*"); chromeOptions.addArguments("window-size=1024,1324"); chromeOptions.addArguments("--blink-settings=imagesEnabled=false"); -
WebDriver UDF - Help & Support (II)
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Hi Danp2, I want hide cmd run chromedriver When i see line code but i don't find any function config ? var driverService = ChromeDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; var driver = new ChromeDriver(driverService, new ChromeOptions()); You can suggest help me. Thanks -
WebDriver UDF - Help & Support
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Hi Danp 2, thanks you reply -
[Help] Combine file txt with both name
ngocthang26 posted a topic in AutoIt General Help and Support
Thank so much view my topic. I have problem when want to combine many file txt have both name. Example: A.txt -> ( A,B,C ) A (1).txt -> (D,E,F) A (2).txt -> (1,2,3) B.txt -> ( 2 ) B (1).txt -> ( 3 ) With code have result, All line code combine with name original A.txt -> ( A,B,C,D,E,F,1,2,3 ) B.txt -> ( 2,3 ) Thanks anyone. -
WebDriver UDF - Help & Support
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
@Jos: my network slow, so comment duplicate. i don't see button delete, Beacause i report my duplicate, after 1min i have change text. -
WebDriver UDF - Help & Support
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Hi Danp2, i have problem code add extension. I try many code but don't work. Sorry i have bad code. I hope you change help me code add extension working. Base link: http://chromedriver.chromium.org/extensions Code: {"capabilities":{"alwaysMatch":{"chromeOptions":{"AddExtensions":"C:/chrome/webcrt.crx","w3c":true}}}} Thanks you so much. Chromedriver no start. i don't know convert code is json -
WebDriver UDF - Help & Support
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Hi @Danp2 I try very many code but don't set success Proxy. $sDesiredCapabilities = '{"capabilities":{"chromeOptions": {"w3c": "true","browserName": "chrome", "args": ["disable-web-security"], "proxy": {"proxyType":"manual","httpProxy":"10.179.70.127:10801","sslProxy":"10.179.70.127:10801","autodetect": "false"}}}}' You can try help me, i try link you sent but don't know transfer code. -
WebDriver UDF - Help & Support
ngocthang26 replied to Danp2's topic in AutoIt General Help and Support
Hi Danp2 I want before Navigate browser set my proxy ( ngocthang1.vpn.co:8899:ngocthang26:ngocthang26 ) and add ABP extension, I see you suggest 2 link for everyone + http://chromedriver.chromium.org/capabilities + http://chromedriver.chromium.org/extensions But i don't know transfer to DesiredCapabilities, How do set proxy ? sorry i very bad code. #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities $_WD_DEBUG = False $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true }}}}' SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.google.com/") _WD_Window($sSession, 'maximize','') ;~ $hwnd = WinWaitActive("Google") ;~ WinSetState($hwnd, "", @SW_MAXIMIZE) _WD_Action($sSession, "refresh") Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path=' & @ScriptDir & '\chrome.log') EndFunc Thanks you -
WebDriver UDF (W3C compliant version) - 2024/09/21
ngocthang26 replied to Danp2's topic in AutoIt Example Scripts
Hi everyone, i have problem. How do add extension and change user agent ? set proxy?. Help me. Thanks