Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to test the reset functionality in a page
#1
Solved: 11 Years, 4 Months ago
Hi,

I have to verify the Reset button functionality in my application.

There are group of Web edit , web list, radio button object s present in a page,I have to pass the values and click on Reset button so that default values will be resetted.

CAn anyone sugget how to test n send me the code.

Thanks in advance
Reply
#2
Solved: 11 Years, 4 Months ago
what kind of difficulties you are facing for this test?
You can just pass the values to your controls on the page using 'Set', 'Select' pr whatever applicable.
then click on reset button and check for each control whether they have reset or not as per the AUT functionality.

try with the above logic and let us know your issues if any.

Reply
#3
Solved: 11 Years, 4 Months ago
Hi Saket,

I am asking how to verify in QTP?

I have to write a script to test this functionality?
Reply
#4
Solved: 11 Years, 4 Months ago
does the logic mentioned in my earlier post works?

Reply
#5
Solved: 11 Years, 4 Months ago
Thanks Saket.

Can u frame it in VB script and sent?

I have written script for Setting the values ,but once we click on reset button how to check whether the values have been reset or not?
Reply
#6
Solved: 11 Years, 4 Months ago
Yes definitely, I can do this for you, But it may take time.
It is always a good idea to paste your lines of code whatever you have tried.
I will try to help you with your code itself and that will be much easier.

make sense? Smile

Reply
#7
Solved: 11 Years, 4 Months ago
First I thought of retriving all the default values and store into an excel,then To set the values and click on reset button.

Again store al the current values into an another excel,then comparing two excel sheets


''Create a Description object to help retrieve all WebEdit objects in a specific page.
Code:
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebEdit"
''Retrieve all WebEdit objects from this page.
Set EditCollection = .Frame(setFrame("admin")).ChildObjects(oDesc)
NumberOfEdits = EditCollection.Count
For i = 0 To NumberOfEdits - 1
CurrentValue = EditCollection(i).GetROProperty("text")
Next
Reply
#8
Solved: 11 Years, 4 Months ago
Yes you can do that with your logic, also rather creating an excel and compare you can store the values in arrays and compare the two arrays after reset.

Reply
#9
Solved: 11 Years, 4 Months ago
Hi,
Just added few stuff to your code

Code:
Sub ChildObjects_Example()

Dim ValueToSet, NumberOfEdits
ValueToSet = " "
Set oDesc = Description.Create()
    oDesc("micclass").Value = "WebEdit"
Set EditCollection = Browser("xxx").Page("xxx").Frame("main").ChildObjects(oDesc)
NumberOfEdits = EditCollection.Count
msgbox NumberOfEdits
For i = 0 To NumberOfEdits -1
    If EditCollection(i).GetROProperty("micclass") = "WebEdit" Then
       EditCollection(i).Set ValueToSet  ('Here ValueToSet is empty i.e " "
    End If
Next
End Sub
Call ChildObjects_Example()
Reply
#10
Solved: 11 Years, 4 Months ago
Thanks much Saket n Venkat .

Here how to create an array with the size where we do not know the size?

Venkat as per your code we store the count intoan variable,so I have decalreda as below

Dim myarray(NumberOfEdits)

but while running it thrown an error saying a numeric need to be given.


please correct me If am wrong

Guys,

I have resolved the above issue
I was trying to get the value of text property instead of Value property.

Now my problem is Once I click on reset button,do I need to call the same function?
If yes the array values will be replaced with the new values as array is declared with in the function.

can u help me in comparing the arrays?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Ascii Characters Appear while typing in Test Page SaiJyothsana 2 2,823 11-10-2010, 04:52 PM
Last Post: SaiJyothsana
  problem with copy functionality vijay44 1 1,732 02-03-2010, 02:19 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 3 Guest(s)