pempemHY Posted November 22, 2018 Share Posted November 22, 2018 @Danp2 i will try Link to comment Share on other sites More sharing options...
truong2301 Posted November 25, 2018 Share Posted November 25, 2018 I want to use a user agent. On 22/11/2018 at 4:54 AM, Danp2 said: @pempemHY I tried running your code, but it seemed to get hung up in this area -- $button_go = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[@id='u_0_1w']") _WD_ElementAction($sSession, $button_go, 'click') Not sure what this should be doing. Would really help if you could provide a much simpler example to review. Link to comment Share on other sites More sharing options...
Danp2 Posted November 25, 2018 Author Share Posted November 25, 2018 51 minutes ago, truong2301 said: I want to use a user agent. That's nice. What have you tried on your own? truong2301 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
truong2301 Posted November 25, 2018 Share Posted November 25, 2018 1 minute ago, Danp2 said: That's nice. What have you tried on your own? I want to use the user-agent Android to access the website. Link to comment Share on other sites More sharing options...
Danp2 Posted November 25, 2018 Author Share Posted November 25, 2018 http://lmgtfy.com/?q=webdriver+user+agent truong2301 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
truong2301 Posted November 25, 2018 Share Posted November 25, 2018 35 minutes ago, Danp2 said: That's nice. What have you tried on your own? How to sent text to input bro? Thanks Link to comment Share on other sites More sharing options...
Danp2 Posted November 25, 2018 Author Share Posted November 25, 2018 In the future, please use the following method for posting code -- 19 minutes ago, truong2301 said: How to sent text to input You're using the wrong value (name) for the $sCommand parameter. For an example of the proper technique, look at the DemoElements function in wd_demo. P.S. Your questions would better fit into the GH&S thread. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
truong2301 Posted November 25, 2018 Share Posted November 25, 2018 1 minute ago, Danp2 said: In the future, please use the following method for posting code -- You're using the wrong value (name) for the $sCommand parameter. For an example of the proper technique, look at the DemoElements function in wd_demo. P.S. Your questions would better fit into the GH&S thread. thanks bro Link to comment Share on other sites More sharing options...
PaulC Posted December 2, 2018 Share Posted December 2, 2018 Hi Dan, I try to use your UDF, but error happened #include "wd_core.au3" #include "wd_helper.au3" Local $sSession Local $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "http://google.com") _WD_DeleteSession($sSession) _WD_Shutdown() Win 10, 64bit Firefox 55 64bit Link to comment Share on other sites More sharing options...
Danp2 Posted December 2, 2018 Author Share Posted December 2, 2018 12 hours ago, PaulC said: Firefox 55 64bit Please explain why you are running such an old version of Firefox. Also what version of the gecko driver are you using? Have you tried with current versions of both? PaulC 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
PaulC Posted December 3, 2018 Share Posted December 3, 2018 Hi Dan, I am using ff55 for Imacros 8.9.7 and use lastest version of gecko. Is the use of the lastest version of FF a mandatory requirement for using this UDF? Link to comment Share on other sites More sharing options...
Danp2 Posted December 3, 2018 Author Share Posted December 3, 2018 Hi Paul, 1 hour ago, PaulC said: Is the use of the lastest version of FF a mandatory requirement for using this UDF? No, but as you've seen it may not work with older versions since the goal is to be compatible with the latest w3c standards. If you can, try your code with the latest FF and let me know the outcome. Dan PaulC 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
PaulC Posted December 3, 2018 Share Posted December 3, 2018 18 minutes ago, Danp2 said: Hi Paul, No, but as you've seen it may not work with older versions since the goal is to be compatible with the latest w3c standards. If you can, try your code with the latest FF and let me know the outcome. Dan I've tried with Chrome and have good result, thank you Dan. Link to comment Share on other sites More sharing options...
CYCho Posted December 5, 2018 Share Posted December 5, 2018 (edited) Hi Dan, After I updated the WebDriver UDF and ChromeDriver to the latest versions, I see a behaviour I did not experience before. When _WD_GetSource or _WD_FindElement funtions are called while an alert box is open, the alert box is automatically closed. It is not an "accept". It just closes. I did not test other functions except these two. Please have a look. Thank you always. CY Cho #include "wd_core.au3" #include "wd_helper.au3" $url = 'http://cafe.golf.sbs.co.kr/html/front/club/board/view.jsp?bd_no=93083&site_id=7146&bltin_no=27423995&page=1&sc_flag=all&sc_keyword=' Local $sDesiredCapabilities $_WD_DEBUG = False SetupChrome() _WD_Startup() _WD_Navigate($sSession, $url) Sleep(5000) $sSource = _WD_GetSource($sSession) Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path=' & @ScriptDir & '\chrome.log') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized", "disable-infobars"] }}}}' EndFunc Edited December 5, 2018 by CYCho Inserted a reproducer code. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
CYCho Posted December 5, 2018 Share Posted December 5, 2018 The above code is just a reproducer showing disappearance of an alert box upon encounter with _WD_GetSource. My actual codes look like below where I keep "accepting" 2 or 3 alerts until I find a certain string in the source. This code used to work with no problem, but now I cannot "accept" the alerts because _WD_GetSource in the while loop kills the alert before I can accept it. While Not StringInStr(_WD_GetSource($sSession), "ReservationCancel") If _WD_Alert($sSession, "status") Then _WD_Alert($sSession, "accept") EndIf Sleep(500) WEnd zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Danp2 Posted December 5, 2018 Author Share Posted December 5, 2018 @CYCho This is the correct behavior AFAICS. You can modify this by using the unhandledPromptBehavior designation in the desired capacities string. See here for the available options. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
CYCho Posted December 5, 2018 Share Posted December 5, 2018 @Danp2Thank you. I inserted '"unhandledPromptBehavior": "ignore", ' in front of "goog:chromeOptions and it works as before. So, I understand that the current version of chromedriver is in more cmpiiance with W3C. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
HJL Posted December 7, 2018 Share Posted December 7, 2018 Hi Dan,we have the problem that every time a new temporary rust-xxx ... profile is created, but we need some plugins and addons in the profile. We would therefore like to use a previously created custom profile as a template or our profile itself. We have been testing for hours but each time a new rust-xxx ... profile was created although our profile is also used (because it can not be deleted), but the program simply stops after starting Firefox. Where is the issue, how can we use our profile and the program continues?Best regards Hans Jürgen $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true,"moz:firefoxOptions":{"binary":"C:\\Program Files\\Mozilla Firefox AU3\\firefox.exe","args":["-profile", "C:\\Users\\workaholicus.BLP2011\\AppData\\Local\\Temp\\FFAU3ProfileZ"]}}}' Link to comment Share on other sites More sharing options...
Danp2 Posted December 7, 2018 Author Share Posted December 7, 2018 Hi Hans, This issue was previously disccussed here, so may want to review that (in particular, the reference to the issue on Github). Not sure if this will work for you, but here's how I run with my standard user profile in Firefox -- Start Firefox manually with the "--marionette" option Use these settings to connect to the existing browser instance _WD_Option('DriverParams', '--log trace --connect-existing --marionette-port 2828') Dan Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
davidnina333 Posted December 8, 2018 Share Posted December 8, 2018 @Danp2 Hi, How can I open multiple firefox browsers at the same time ? Every firefox is a different profile. Thanks. 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