Get Hidden Field Value

4 posts, 0 answers
  1. Zaki
    Zaki avatar
    8 posts
    Member since:
    Oct 2015

    Posted 03 Nov 2015 Link to this post

    Hi,

    i got the following hidden input field

    <input id="regit" type="hidden">

    I got two issues here

    1. Get the value of regit

    2. Use the value to Navigate To a url 

    Any ideas?

     Zaki.

  2. Zaki
    Zaki avatar
    8 posts
    Member since:
    Oct 2015

    Posted 03 Nov 2015 Link to this post

    Here is what i tried so far, but it aint working yet

     

    var hiddenFieldControl =Pages.MyPageName.Get<HtmlInputHidden>("id=Global_RegID");          
    var fieldValue = hiddenFieldControl.Value;
        
    ActiveBrowser.NavigateTo("http://SecretIP/folder/start.html#/introduction?regId=" + fieldValue , true);

  3. Zaki
    Zaki avatar
    8 posts
    Member since:
    Oct 2015

    Posted 03 Nov 2015 Link to this post

    And after hell lots of debugging,

    The above does not work as i wait for an ajax call to update the hidden value and that is were i am stuck.

  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1043 posts

    Posted 06 Nov 2015 Link to this post

    Hello Zaki,

    Thank you for contacting us.

    Here is the code which should work correctly:

    HtmlInputHidden input = ActiveBrowser.Find.ById<HtmlInputHidden>("regit");
    ActiveBrowser.NavigateTo("http://SecretIP/folder/start.html#/introduction?regId=" + input.Value.ToString(), true);

    It finds the hidden input by its ID and then navigates + its value.

    Let me know if that helps.

    Regards,
    Boyan Boev
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top