Danpol Posted July 18, 2019 Share Posted July 18, 2019 Not the topmost, so i can check what is it doing, but not allow it to disturb. Yea, now i see "search -> this topic", sorry, I'm blind Link to comment Share on other sites More sharing options...
Danp2 Posted July 18, 2019 Author Share Posted July 18, 2019 @Danpol Other than running "headless", I'm not aware of a way to prevent the focus change. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Math43 Posted July 19, 2019 Share Posted July 19, 2019 Hi, Do you know if it's possible to run multiple instances of chrome webdriver ? Regards, Math Link to comment Share on other sites More sharing options...
Danp2 Posted July 19, 2019 Author Share Posted July 19, 2019 @Math43 I believe it is technically possible, but it's unclear why you would want / need to do this. Please give additional details on your use case. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
trangtrau Posted July 22, 2019 Share Posted July 22, 2019 Hi everyone , I have 1 web code <img id="wlspispHIPBimg0b608e68c33294658a1503edc3d55e2eb0" aria-label="NiceGirl" alt="NiceGirl" src="https://kenh14cdn.com/2019/2/24/3561716420480213454575853861059020806684672n-15510057259571546306615.jpg" style="display: inline; width: 100%; height: auto; max-width: 200px;" class="text-body"> Now I want get the text "https://kenh14cdn.com/2019/2/24/3561716420480213454575853861059020806684672n-15510057259571546306615.jpg" I use this code $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//img[@alt='NiceGirl']@src") $sValue = _WD_ElementAction($sSession, $sElement, 'attribute') MsgBox(0,0,$sValue) But not success, can you tell me, what's wrong in my code. Thank ! Link to comment Share on other sites More sharing options...
Gianni Posted July 22, 2019 Share Posted July 22, 2019 (edited) use the _WD_ElementAction function like this: $sValue = _WD_ElementAction($sSession, $sElement, 'attribute', 'src') p.s. ... and remove @src from the xPath: "//img[@alt='NiceGirl']" Edited July 22, 2019 by Chimp trangtrau, FrancescoDiMuro and Danp2 2 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...
trangtrau Posted July 22, 2019 Share Posted July 22, 2019 3 hours ago, Chimp said: use the _WD_ElementAction function like this: $sValue = _WD_ElementAction($sSession, $sElement, 'attribute', 'src') p.s. ... and remove @src from the xPath: "//img[@alt='NiceGirl']" thank you so much Link to comment Share on other sites More sharing options...
trangtrau Posted July 22, 2019 Share Posted July 22, 2019 How to hide this popup, run in SciTE is OK, but when build exe it not hide @@ Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 @trangtrau Answered in the other thread. Please don't cross-post. trangtrau 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
trangtrau Posted July 22, 2019 Share Posted July 22, 2019 1 hour ago, Danp2 said: @trangtrau Answered in the other thread. Please don't cross-post. Sorry i wrong Link to comment Share on other sites More sharing options...
lponthepc Posted July 22, 2019 Share Posted July 22, 2019 Hello Danp2, you mentioned _WD_ElementOptionSelect, but I am trying to select an item in an "ul" unordered list. Can you use this for that ... also you make a mention of you added _WD_ElementOptionSelect in wd_core.au3, but I don't see it in the file... no header description or anything... Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 You must be running an older version of the UDF. That function was added in V0.1.0.18, and were now up to V0.1.0.20. P.S. This function is in wd_helper.au3, since it isn't one of the "core" webdriver functions Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
trangtrau Posted July 23, 2019 Share Posted July 23, 2019 how to set language display of website. I wite a auto base english web. But when run other PC it not display english than my tool not run Link to comment Share on other sites More sharing options...
Danp2 Posted July 23, 2019 Author Share Posted July 23, 2019 @trangtrau We can't provide assistance without additional details. For starters, what is the website's URL? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
trangtrau Posted July 23, 2019 Share Posted July 23, 2019 2 hours ago, Danp2 said: @trangtrau We can't provide assistance without additional details. For starters, what is the website's URL? ex: https://signup.live.com/signup?lcid=1 the language follow base of pc seting or chrome setting. But i want it allway display english. I search google but don't know how to config webdriver: My chrome_startup : 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, "binary":"' & StringReplace (@ScriptDir, "\", "/") & '/Chrome/App/Chrome-bin/chrome.exe"}}}}' EndFunc how to convert the value lang form options = webdriver.ChromeOptions() options.add_experimental_option('prefs', {'intl.accept_languages': 'en,en_US'}) driver = webdriver.Chrome(chrome_options=options) Link to comment Share on other sites More sharing options...
Danp2 Posted July 23, 2019 Author Share Posted July 23, 2019 @trangtrau Could be wrong, but I believe add_experimental_option is specific to selenium. There's an example of setting the prefs option here. Suggest that you review that and then adapt your desiredCapabilities string to suit your needs. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
trangtrau Posted July 23, 2019 Share Posted July 23, 2019 14 minutes ago, Danp2 said: @trangtrau Could be wrong, but I believe add_experimental_option is specific to selenium. There's an example of setting the prefs option here. Suggest that you review that and then adapt your desiredCapabilities string to suit your needs. thank you, It success with code Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"' ) $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions":{"prefs": {"intl.accept_languages": "vi,vi_VI"},"w3c":true, "binary":"' & StringReplace (@ScriptDir, "\", "/") & '/Chrome/App/Chrome-bin/chrome.exe"}}}}' EndFunc Link to comment Share on other sites More sharing options...
_leo_ Posted July 26, 2019 Share Posted July 26, 2019 Dear friends of modern technology😀 I run into a small problem with the webdriver udf: The URL bar remains selected after, when I navigate to a website for the first time (after Create Session) Like this: $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.google.com/") Has anyone got a good idea how to solve this? My idea was to refresh the page using _WD_Action or just perform a regular mouseclick on a random location. But I feel that there is a more attractive way to solve this? Thanks for help! Link to comment Share on other sites More sharing options...
Danp2 Posted July 26, 2019 Author Share Posted July 26, 2019 @_leo_ That isn't what I'm seeing with both Chrome and Firefox. Perhaps you can provide a more detailed description of your environment, ie -- Windows version Webdriver UDF version Browser name and version etc You could also post a simple, but complete script that we can run to observe the issue. Finally, you might want to explain why this is causing a problem for you. 😉 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
_leo_ Posted July 27, 2019 Share Posted July 27, 2019 @Danp2 I am using windows 10, Google Chrome with Version 75.0.3770.142. and the latest UDF version. I figured out that this is caused by "user-data-dir=userData", since it doesnt happen if I delete this part. Does anyone have an idea on how to have all the user data without the url bar getting highlighted? #include "wd_core.au3" #include "wd_helper.au3" Global $sSession, $sSession2 Global $sDesiredCapabilities SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "http://www.google.com") 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", "user-data-dir=userData"] }}}}' EndFunc And the reasons are: 1. I seem to get more "element not interactable" errors when the focus remains on the url. 2. It hurts my eyes 😅 Link to comment Share on other sites More sharing options...
Recommended Posts