Danp2 Posted November 13, 2020 Author Share Posted November 13, 2020 @NassauSky According to the W3C specs, the webdriver will automatically scroll the element into view when doing things like click it, setting its value, etc. If you need to manually scroll an element into view, then see my earlier response here -- NassauSky 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted November 14, 2020 Author Share Posted November 14, 2020 @NassauSky Another possible solution would be to use _WD_ElementActionEx with the hover action. NassauSky 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
samibb Posted November 16, 2020 Share Posted November 16, 2020 Dear Danp2 I am Using a Windows shortcut that points to the executable. How i make the additional parameters? Link to comment Share on other sites More sharing options...
Danp2 Posted November 16, 2020 Author Share Posted November 16, 2020 @samibb Ever hear of Google? 🙄 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
samibb Posted November 17, 2020 Share Posted November 17, 2020 Dear @Danp2 i have this page already opened in chrome browser. i tried to to attached with it by using _WD_Attach(_WD_Attach($sSession, "Amadeus Retailing Platform - PRD(PRODUCTION) - Google Chrome", Default), my problem how getting "$sSession " ID Thanks in advance Link to comment Share on other sites More sharing options...
Danp2 Posted November 17, 2020 Author Share Posted November 17, 2020 @samibb Haven't we already been down this road before? Suggest that you go back and reread our recent interactions as the code I posted shows how to launch Chrome and subsequently obtain the session ID. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
VodkaDiva Posted November 18, 2020 Share Posted November 18, 2020 Hi @Danp2 ! i have search about chagne Screen resolution webdriver . but don't have in forum . and i search google . have thist code . https://www.browserstack.com/docs/automate/selenium/change-screen-resolution Can you help me ? trans this code on web to autoit ? Thanks danp2 xxxxxxxxxxx Link to comment Share on other sites More sharing options...
samibb Posted November 18, 2020 Share Posted November 18, 2020 Dear @Danp2 i have spend 6 hours trying to solve it still open new web page I am not very expert so i need your help please. expandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Local $sDesiredCapabilities, $sSession ;ShellExecute("chrome.exe", "--remote-debugging-port=9222") SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "HTTP://intranet.airlineretailing.amadeus.com:55001/1ASIHGAPSV/signin/index.html?TXT=Retailing%20Platform&URL=/1ASIHGAPSV/arp/index.html") 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": {"debuggerAddress": "localhost:9222"}}}}' EndFunc ------------------------------------------------------------------------------------------------------------------------------------------- >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\11003813\Desktop\AutoIT\xxxx.au3" /UserParams +>14:01:25 Starting AutoIt3Wrapper v.16.612.1119.0 SciTE v.3.6.6.0 Keyboard:00000409 OS:WIN_81/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\11003813\Desktop\AutoIT\xxxx.au3 +>14:01:25 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\11003813\Desktop\AutoIT\xxxx.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WDStartup: OS: WIN_81 WIN32_NT 9600 _WDStartup: AutoIt: 3.3.14.2 _WDStartup: WD.au3: 0.3.1.0 (Up to date) _WDStartup: WinHTTP: 1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>) _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --verbose --log-path="C:\Users\11003813\Desktop\AutoIT\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"}}}} __WD_Post: StatusCode=0; ResponseText=WinHTTP request timed out before Webdriver... __WD_Post ==> Send / Recv error: WinHTTP request timed out before Webdriver _WD_CreateSession: WinHTTP request timed out before Webdriver _WD_CreateSession ==> Webdriver Exception: HTTP status = 0 __WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"HTTP://intranet.airlineretailing.amadeus.com:55001/1ASIHGAPSV/signin/index.html?TXT=Retailing%20Platform&URL=/1ASIHGAPSV/arp/index.html"} __WD_Post: StatusCode=0; ResponseText=WinHTTP request timed out before Webdriver... __WD_Post ==> Send / Recv error: WinHTTP request timed out before Webdriver _WD_Navigate: WinHTTP request timed out before Webdriver _WD_Navigate ==> Send / Recv error: HTTP status = 0 Thanks in advance Link to comment Share on other sites More sharing options...
Danp2 Posted November 18, 2020 Author Share Posted November 18, 2020 @VodkaDiva That appears to be a Selenium feature, so isn't available AFAICS in the base webdriver specs. You can set the window size and position using _WD_Window, but not sure that meets your specific goals. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted November 18, 2020 Author Share Posted November 18, 2020 2 hours ago, samibb said: _WDStartup: WinHTTP: 1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>) This information is here for a reason. Follow the directions if you want the UDF to work correctly. See my earlier reply if you still don't understand. Also, you need to explain in detail how the existing Chrome instance was launched. Be specific and be sure to show us that you used the --remote-debugging-port parameter. Note -- You can use telnet to test if the port is open. From the command line, enter telnet localhost 9222 If you get the following response, then the port isn't open Connecting To localhost...Could not open connection to the host, on port 9222: Connect failed Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
VodkaDiva Posted November 19, 2020 Share Posted November 19, 2020 Thanks danp2 ! 😄😄 xxxxxxxxxxx Link to comment Share on other sites More sharing options...
samibb Posted November 19, 2020 Share Posted November 19, 2020 Dear @Danp2 I have update winhttp.au3 file. 2 I've got this response Connecting To localhost...Could not open connection to the host, on port 9222: Connect failed i think should open the local host on port 9222. Thanks Link to comment Share on other sites More sharing options...
Danp2 Posted November 19, 2020 Author Share Posted November 19, 2020 @samibb That indicates to me that you didn't launch Chrome with the correct options. 😞 At this point, I would recommend that you start your own thread seeking help since we haven't been able to move beyond this issue. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NassauSky Posted November 24, 2020 Share Posted November 24, 2020 Does anyone have any idea how to get the parent of an element: $mElement = _WD_GetMouseElement($sSession) I'm interested in the outerHTML of the parent of the element under the mouse. Thanks for any guidance. Link to comment Share on other sites More sharing options...
Danp2 Posted November 24, 2020 Author Share Posted November 24, 2020 @NassauSky You should be able to do it with _WD_FindElement (pass $mElement as the starting element and use ".." as the xpath) or _WD_ExecuteScript. NassauSky 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NassauSky Posted November 24, 2020 Share Posted November 24, 2020 (edited) Thanks @Danp2. I tried that before asking but it doesn't return a value: expandcollapse popup#include <Constants.au3> #include "wd_core.au3" #include "wd_helper.au3" HotKeySet ( "{F2}", "_XpathMouseElem" ) HotKeySet ( "{F10}", "_Exit" ) $_WD_DEBUG = $_WD_DEBUG_None ; to hide ChromeDriver console Local $sDesiredCapabilities = SetupChrome() _WD_Startup() Sleep(2000) _WD_ConsoleVisible() Local $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "http://www.google.com") Do Sleep (50) Until False Func _Exit() _WD_DeleteSession($sSession) _WD_Shutdown() Exit EndFunc Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') Return '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}' EndFunc ;==>SetupChrome Func _XpathMouseElem() $mElement = _WD_GetMouseElement($sSession) MsgBox($MB_TOPMOST, "Mouse Element Info", $mElement) ;Returns the id of the element under the mouse ;---- Find outer HTML of element under mouse after F2 $sValue1 = _WD_ElementAction($sSession, $mElement, 'property', 'outerHTML') ; or innerText // was aElement MsgBox(0,"Element OuterHTML",$sValue1 ) ;---- Find outer HTML of parent $sElement = _WD_FindElement($mElement, $_WD_LOCATOR_ByXPath, '/..', Default, True) $sValue2 = _WD_ElementAction($sSession, $sElement, 'property', 'outerHTML') ; or innerText MsgBox(0,"Parent OuterHTML",$sValue2 ) EndFunc ;==>_XpathMouseElem Simply press F2 over an element and you'll see what I mean. Thanks. Edited November 24, 2020 by NassauSky Link to comment Share on other sites More sharing options...
Gianni Posted November 24, 2020 Share Posted November 24, 2020 @NassauSky change this line $sElement = _WD_FindElement($mElement, $_WD_LOCATOR_ByXPath, '/..', Default, True) with this $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '..', $mElement, Default) NassauSky 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
NassauSky Posted November 24, 2020 Share Posted November 24, 2020 (edited) @Chimp Thanks The extra parameter in the 2nd to last position. Let me try that now. Update. YES woooo! Thanks @Chimp and @Danp2 Edited November 24, 2020 by NassauSky Link to comment Share on other sites More sharing options...
satter Posted November 25, 2020 Share Posted November 25, 2020 Can anyone help me to use webdriver to bypass cloudflare. I run webdriver chrome but still reloaded for 5 seconds checking cloudflare. Link to comment Share on other sites More sharing options...
Danp2 Posted November 25, 2020 Author Share Posted November 25, 2020 @satter AFAIK, there's no way to bypass cloudflare. Otherwise, what would be the point of using it? Suggest that you post a short "reproducer" script that we can run to observe whatever issue you are having. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now