Danp2 Posted July 12, 2019 Author Share Posted July 12, 2019 @Letraindusoir I posted an example of how to do this just yesterday in this very thread. P.S. If you have questions on the JSON functions, best to post them over in that thread. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted July 14, 2019 Author Share Posted July 14, 2019 On 7/11/2019 at 2:52 PM, Holycow said: Please do let me know if you have the library functions updated and I will download a new copy I released an update earlier today on Github. This should fix the issue where _WD_Attach was failing when the prior active tab has been closed Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
lponthepc Posted July 22, 2019 Share Posted July 22, 2019 If I use the chrome driver and click on a link in my script for a website, and that link creates another tab, how can I attach to the new tab that was created using the chrome driver??? Also, is there any documentation for the chrome driver methods??? Like _WD_CreateSession($sDesiredCapabilities='{}') _WD_DeleteSession($sSession) _WD_Status() _WD_Timeouts($sSession, $sTimeouts = '') _WD_Navigate($sSession, $sURL) _WD_Action($sSession, $sCommand) _WD_Window($sSession, $sCommand, $sOption = '') etc... I have found no documentation for these methods??? Can anyone help??? Link to comment Share on other sites More sharing options...
lponthepc Posted July 22, 2019 Share Posted July 22, 2019 Does anyone have an example using the Chrome driver, on how do you click on a link to download a file, and access that file name to rename it??? All through the chrome webdriver??? Link to comment Share on other sites More sharing options...
lponthepc Posted July 22, 2019 Share Posted July 22, 2019 In my script here for Chrome... Sleep(3000) $sReportOpt = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//a[@class='menu-icon-report']") _WD_ElementAction($sSession, $sReportOpt, 'click') My _WD_ElementAction creates a new tab... how do I attach to that new tab that was created when this method is executed??? And then when I am done with this tab, how do I close it??? Link to comment Share on other sites More sharing options...
lponthepc Posted July 22, 2019 Share Posted July 22, 2019 3 minutes ago, lponthepc said: In my script here for Chrome... Sleep(3000) $sReportOpt = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//a[@class='menu-icon-report']") _WD_ElementAction($sSession, $sReportOpt, 'click') My _WD_ElementAction creates a new tab... how do I attach to that new tab that was created when this method is executed??? And then when I am done with this tab, how do I close it??? I saw the _WD_Attach examples... but that was for "URL's" ... this new tab was created when I click on a link in the website... so this may be different I'm thinking... Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 22, 2019 Share Posted July 22, 2019 On 7/13/2019 at 2:14 AM, Danp2 said: @Letraindusoir I posted an example of how to do this just yesterday in this very thread. P.S. If you have questions on the JSON functions, best to post them over in that thread. I went to send a post, and no one actually cared about the problem itself. Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 22, 2019 Share Posted July 22, 2019 In fact, this problem is very meaningful. Without knowing the specific return value, the next step can be made by judging the possible shape of the return value, which can make the code more robust, stable and reliable. Response={"value":null} Response={"value":""} Response={"value":[]} Response={"value":{}} Response={"value":True} Response={"value":1000} Response={"value":["TX0058_2","TX0058_5"]} Response={"value":{"TX0058_2":"A","TX0058_5":"D"]} As shown above. If the value 'Response' I get may be one of the above results, I want to further resolve the value of '[value]', what functions or methods can I use to distinguish them? Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 22, 2019 Share Posted July 22, 2019 (edited) In addition, there are some questions : 1, how to switch to a specified tab? 2, how to close one of several tabs? Open the new tab. I know I can use _ WD_NewTab.. But I haven't figured out which function to use in the above question and how to use it. Edited July 22, 2019 by Letraindusoir Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 5 hours ago, lponthepc said: how can I attach to the new tab that was created 39 minutes ago, Letraindusoir said: how to switch to a specified tab? _WD_Attach is the function you seek. It handles locating and then switching to the designated tab. There are examples of using it in wd_demo. 😉 Letraindusoir 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 5 hours ago, lponthepc said: Also, is there any documentation for the chrome driver methods??? I have found no documentation for these methods??? Can anyone help??? Again, I would refer you to wd_demo for examples of using most of the available functions. Looking at the UDF's source code, you will find links in many of the functions that take you to the appropriate section of the W3C specs, which is the ultimate reference for anything webdriver related. For example -- ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WD_CreateSession ; Description ...: Request new session from web driver ; Syntax ........: _WD_CreateSession([$sDesiredCapabilities = '{}']) ; Parameters ....: $sDesiredCapabilities- [optional] a string value. Default is '{}'. ; Return values .: Success - Session ID to be used in future requests to web driver session ; Failure - Empty string ; @ERROR - $_WD_ERROR_Success ; - $_WD_ERROR_Exception ; @EXTENDED - WinHTTP status code ; Author ........: Dan Pollak ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://www.w3.org/TR/webdriver#new-session ; Example .......: No ; =============================================================================================================================== See the link entry near the bottom. Going there will take you to the New Session entry in the webdriver specs. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 22, 2019 Share Posted July 22, 2019 Thanks Dan ! but how to close one of several tabs? I can't believe I don't know how to close the tab. Danp2 1 Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 5 hours ago, lponthepc said: And then when I am done with this tab, how do I close it??? 50 minutes ago, Letraindusoir said: how to close one of several tabs? Come on guys... How about you put in a little effort. This has been discussed previously. Use google or the forum search function. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 5 hours ago, lponthepc said: I saw the _WD_Attach examples... but that was for "URL's" ... this new tab was created when I click on a link in the website... so this may be different I'm thinking... To use _WD_Attach, you'll need to know something about the new tab. You options are to use title, URL, or HTML. This is documented in the function header. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 1 hour ago, Letraindusoir said: I went to send a post, and no one actually cared about the problem itself. I believe they had difficulty understanding your situation because you only gave raw JSON without any context or code. Apparently, you didn't bother to locate the example I previously mentioned. Care to explain why? 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 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 The short answer is $_WD_ERROR_MSGBOX = False However, you shouldn't be getting this error box on a return value of Success. I'll have to take another look at this, but I thought this issue was recently fixed. Please make sure that you are running the latest version of the UDF (currently 0.1.0.20) 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 3 minutes ago, Danp2 said: @trangtrau The short answer is $_WD_ERROR_MSGBOX = False However, you shouldn't be getting this error box on a return value of Success. I'll have to take another look at this, but I thought this issue was recently fixed. Please make sure that you are running the latest version of the UDF (currently 0.1.0.20) This is newest vesion, Thank you, i'll try again Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 22, 2019 Share Posted July 22, 2019 2 hours ago, Danp2 said: I believe they had difficulty understanding your situation because you only gave raw JSON without any context or code. Apparently, you didn't bother to locate the example I previously mentioned. Care to explain why? I'm sorry, I'm not very good at English, so the search results are not easy to screen out useful ones. Link to comment Share on other sites More sharing options...
Danp2 Posted July 22, 2019 Author Share Posted July 22, 2019 @Letraindusoir Understood. However, You can't expect us to continuously regurgitate code for you on request. 😉 Use the Google translator if necessary. P.S. This post is the one I was trying to get you to locate earlier for extracting the JSON 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