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

accessing Javascript variables

1 Answer 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pete
Top achievements
Rank 1
Pete asked on 26 Mar 2012, 02:42 PM
Hi Guys,

     I am evaluating the Test Studio Software vs. others and have a question.   Is it possible to access Javascript variables that are located in the "<script></script>" section of a page.

ex.

<script>
 var myVariable = "test string";
<script>

how would i access myVariable from the Javascript in a coded step?

Thanx in advance.

1 Answer, 1 is accepted

Sort by
0
Pete
Top achievements
Rank 1
answered on 26 Mar 2012, 04:03 PM
nm guys,  problem solved. 

string newReq = ActiveBrowser.Actions.InvokeScript("myVariable");  

Tags
General Discussions
Asked by
Pete
Top achievements
Rank 1
Answers by
Pete
Top achievements
Rank 1
Share this question
or