Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

trouble finding element with xpath

View previous topic View next topic Go down

trouble finding element with xpath

Post by imfaus on Wed May 09, 2012 3:00 am

Using IDE I am trying to dynamic locate an element with xpath. Its a text box where you would enter comments here is the source html

in my IDE html code looks like this:

store
xpath=//input[@type='text' and contains(@id, 'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_MerchantTab_ControlUC_CommentCtrl_TextBoxCtrl_I')]
CommentsTextBox



type
${CommentsTextBox}
test



It fails with the following error:
  • info] Executing: |store | xpath=//input[@type='text'
    and contains(@id,
    'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_MerchantTab_ControlUC_CommentCtrl_TextBoxCtrl_I')]
    | CommentsTextBox |
  • [info] Executing: |type | ${CommentsTextBox} | test |
  • [error] Element xpath=//input[@type='text' and
    contains(@id,
    'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_MerchantTab_ControlUC_CommentCtrl_TextBoxCtrl_I')]
    not found

  • I am running IDE 1.7.2
    thanks for a great forum. Its really helped me get to using selenium much better now

    imfaus
    Active particpant
    Active particpant

    Posts : 13
    Join date : 2012-01-13

    Back to top Go down

    Re: trouble finding element with xpath

    Post by ccox on Wed May 09, 2012 5:30 am

    I see a few problems here. Typically if your are storing something in a text box, I would use storeValue as opposed to store.

    The second problem is you must use the order Selenium uses for typing the stored information. First use the type Command, then the Target of where you want to type it, then the ${information}.

    Hopefully this helps.

    -Cameron



    Last edited by ccox on Wed May 09, 2012 5:37 am; edited 1 time in total (Reason for editing : Adding image)

    ccox
    Master
    Master

    Posts : 205
    Join date : 2012-01-06
    Age : 31
    Location : Denver, CO

    Back to top Go down

    Re: trouble finding element with xpath

    Post by imfaus on Wed May 09, 2012 10:46 pm

    I figured it out, the problem I had was how to dynamically find the text box object using contains here is how I made it work. The product is dotnetnuke and the element identifier changes with each build so simply using id=dnn_ctr4579 fails because the number changes each time.
    xpath=//*[contains(@id, 'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_MerchantTab_ControlUC_CommentCtrl_TextBoxCtrl_I')]



    store
    This is a test
    comments


    echo
    ${comments}



    store
    xpath=//*[contains(@id, 'ViewMerchantWizard_MerchantWizard1_cbWizardPanel_MerchantTab_ControlUC_CommentCtrl_TextBoxCtrl_I')]
    CommentsTextBox


    click
    ${CommentsTextBox}



    type
    ${CommentsTextBox}
    ${comments}

    imfaus
    Active particpant
    Active particpant

    Posts : 13
    Join date : 2012-01-13

    Back to top Go down

    Re: trouble finding element with xpath

    Post by Sponsored content Today at 5:48 pm


    Sponsored content


    Back to top Go down

    View previous topic View next topic Back to top

    - Similar topics

     
    Permissions in this forum:
    You cannot reply to topics in this forum