Jump to content

WebDriver - firefox - $_WD_LOCATOR_


goldstar
 Share

Go to solution Solved by Danp2,

Recommended Posts

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

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?

Untitlead.jpg

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...