goldstar Posted February 4, 2022 Share Posted February 4, 2022 hello . i have two question please help me question 1: in "_WD_FindElement" function what are defined constant $_WD_LOCATOR_* for allowed values I cant find them any where question 2 : can i use field names to locate an element and fill them? because site owner change all elements properties every time to avoid using add-ons to fill fields. only name of fields ( text) will remain unchanged Link to comment Share on other sites More sharing options...
Solution Danp2 Posted February 4, 2022 Solution Share Posted February 4, 2022 1) Look in wd_core.au3 around line 73 for the global constant declarations. 2) Not sure what you mean by field names. Can you post an example? What site are you accessing? goldstar 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
goldstar Posted February 5, 2022 Author Share Posted February 5, 2022 I see Thank you very much❤️ i cant link you the site address but i send a picture like it . the red part will remain the same all time .is it tag name? Global Const $_WD_LOCATOR_ByTagName = "tag name" so i can use this const to locate those fileds and write on them? Link to comment Share on other sites More sharing options...
goldstar Posted February 5, 2022 Author Share Posted February 5, 2022 this is the source cod i copied from page <div class="input-item" data-v-11184d92=""><label class="label"><!---->your email:</label><input autocomplete="off" class="ltr green" type="email" placeholder=" please enter valid address" value="abcd@gmail.com"><p class="errors"><ul></ul></p></div> I try to write some thing on this email field . do this cod is corroct? Local $sSession = _MY__WD_SetupFireFox(False) Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByTagName, "your email") Local $sText = _WD_SetElementValue($sSession, $sElement, 'abcd@y.com') after my firefox apear nothing change in that field Link to comment Share on other sites More sharing options...
Danp2 Posted February 5, 2022 Share Posted February 5, 2022 7 hours ago, goldstar said: the red part will remain the same all time .is it tag name? Global Const $_WD_LOCATOR_ByTagName = "tag name" so i can use this const to locate those fileds and write on them? No. Tag names are the element type, such as input, img, span, etc). See here for further details. You will need to find a reliable way to locate the element using either CSS or xpath selectors. There's a Tools listing in the wiki that are helpful with this type of thing. goldstar 1 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