The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Application Center Test

Pages: 1
performancedude
Junior Member


Reged: 12/19/03
Posts: 14
ViewState
      #322348 - 01/28/04 01:52 PM

If I want to make my scripts portable, I can make many static items to dynamic variables, but what about the viewstates? Everytime I have a post I have a viewstate and it can make my script unrunnable in the future and unportable?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Jamie Nichols
Member


Reged: 05/12/03
Posts: 101
Loc: Columbus, OH, USA
Re: ViewState
      #322349 - 01/30/04 01:43 PM

I have yet to see an ACT script with viewstate, which might be due to the type of application you're testing. Is that a cookie value in your case? I guess an example might (or might not) help me.

Post Extras: Print Post   Remind Me!   Notify Moderator  
performancedude
Junior Member


Reged: 12/19/03
Posts: 14
Re: ViewState
      #322350 - 02/02/04 11:55 AM

Jamie,

Here is a good article about viewstate for NET apps.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp11222001.asp


Post Extras: Print Post   Remind Me!   Notify Moderator  
Jamie Nichols
Member


Reged: 05/12/03
Posts: 101
Loc: Columbus, OH, USA
Re: ViewState
      #322351 - 02/03/04 11:51 AM

I've heard of Viewstate with regard to .Net...but I wasn't sure how the ACT tool would record it, if it did at all. And depending on how the script recorded it, might give me some clue as to how to manipulate it. We don't have any .NET applications currently, but will in the future, so I may have to visit this at some point anyhow.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Ian
Member


Reged: 09/13/01
Posts: 332
Loc: Sunnyvale, CA, Santa Clara
Re: ViewState
      #322352 - 02/03/04 01:42 PM

From the ACT Samples, can't remeber which one but I copied it some time ago and it works fine:-

Regards

Ian


'---------------------------------------------------------------------
' SetViewState
'
' Parameters:
'
' [in] g_oResponse : The Response Object
'
' Purpose:
'
' Find __VIEWSTATE in the Response.Body and set it's value.
'---------------------------------------------------------------------
Sub SetViewState(g_oResponse)
Dim Pos, PosStart, PosEnd
Dim res, vState

If (g_oResponse Is Nothing) Then
ActTrace L_ErrRequest_Text
Else
Pos = InStr(g_oResponse.Body, "__VIEWSTATE")
If Pos > 0 Then
PosStart = InStr(Pos, g_oResponse.Body, "value=""")
PosStart = PosStart + Len ("value=""")

PosEnd = InStr(PosStart, g_oResponse.Body, """")

res = Mid(g_oResponse.Body, PosStart, PosEnd - PosStart)
Test.SetGlobalVariable "vState",res
g_ViewState = Test.GetGlobalVariable("vState")
End If
End If
End Sub


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 0 anonymous users are browsing this forum.

Moderator:  AJ 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1298

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5