This is a migrated thread and some comments may be shown as answers.

Get Hidden Field Value

3 Answers 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Zaki
Top achievements
Rank 1
Zaki asked on 04 Nov 2015, 01:16 AM

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.

3 Answers, 1 is accepted

Sort by
0
Zaki
Top achievements
Rank 1
answered on 04 Nov 2015, 04:23 AM

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);

0
Zaki
Top achievements
Rank 1
answered on 04 Nov 2015, 05:35 AM

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.

0
Boyan Boev
Telerik team
answered on 06 Nov 2015, 12:46 PM
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!
Tags
General Discussions
Asked by
Zaki
Top achievements
Rank 1
Answers by
Zaki
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or