Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
imfaus
Active particpant
Active particpant
Posts : 13
Join date : 2012-01-13

trouble finding element with xpath Empty trouble finding element with xpath

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
    avatar
    ccox
    Master
    Master
    Posts : 205
    Join date : 2012-01-06
    Age : 38
    Location : Denver, CO

    trouble finding element with xpath Empty Re: trouble finding element with xpath

    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

    trouble finding element with xpath 2012-05-08_163422


    Last edited by ccox on Wed May 09, 2012 5:37 am; edited 1 time in total (Reason for editing : Adding image)
    avatar
    imfaus
    Active particpant
    Active particpant
    Posts : 13
    Join date : 2012-01-13

    trouble finding element with xpath Empty Re: trouble finding element with xpath

    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}
    Sponsored content

    trouble finding element with xpath Empty Re: trouble finding element with xpath

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