Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB Scripting
#1
Not Solved
Hi Everyone,

I hope someone can help. I am new to software automation testing and have been assigned a task to automate the testing to this app that is used to provision access to, so as you can imagine there are a lot of "checkboxes". What we have first worked out a descriptive code that goes through the app and works out if any of the "checkboxes" are "checked" and first "unchecks" them, then it goes and "checks" them one by one and reports back any errors if there is any issues.

I am wanting a function that goes into the page after a refresh and that passes a message that indicates a "pass" if they're all "checked" or a "fail" if one of them is "unchecked.

Here is the code so far that does what was mention on the first paragraph:
Code:
unction UDF_ProvisionApp(param_array)
    
Set test = description.Create    
test("micclass").value = "WebElement"
test("acc_name").value =  ".*Access has been granted"
test("visible").value = True
test("html tag").value = "A"

Set applicationitems = browser("creationtime:=0").Page("micclass:=Page").ChildObjects(test)

If applicationitems.count = 0 Then
    ' Nothing is checked
else
    For i = 0 to applicationitems.count - 1
        applicationitems(i).click
        wait(2)
    Next
End If



Set test = description.Create    
test("micclass").value = "WebElement"
test("acc_name").value =  ".*Access has been removed"
test("visible").value = True
test("html tag").value = "A"

Set applicationitems = browser("creationtime:=0").Page("micclass:=Page").ChildObjects(test)

expectedCount = applicationitems.count

For i = 0 to applicationitems.count - 1
    applicationitems(i).click
    wait(2)
Next



Set test = description.Create    
test("micclass").value = "WebElement"
test("acc_name").value =  ".*Access has been granted"
test("visible").value = True
test("html tag").value = "A"

Set applicationitems = browser("creationtime:=0").Page("micclass:=Page").ChildObjects(test)

If applicationitems.count = expectedCount Then
'    msgbox "Passed!"
    
'else
'    msgbox "Failed!"
'End If

    RESULTS.InsertResult GLOBAL_STEP_DESCRIPTION,"Granting application access","Granting application access - Success" ,"PASS"
else
    RESULTS.InsertResult GLOBAL_STEP_DESCRIPTION,"Granting application access","Granting application access - Error" ,"FAIL"
End if

End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VB scripting Aisha2015 0 2,396 08-07-2015, 02:21 PM
Last Post: Aisha2015
  Regarding Shell Scripting demoqtp 2 4,386 03-31-2015, 12:34 AM
Last Post: demoqtp
Exclamation How to open a text file through VB scripting.? qtplearner88 2 4,577 06-22-2012, 01:51 PM
Last Post: ravs@788
  NEED help with scripting. Web table, Click Link Clymo 4 7,649 06-08-2012, 08:41 PM
Last Post: sreekanth chilam
  learn VB scripting rajat 3 8,468 05-29-2012, 02:22 PM
Last Post: shivanibehere

Forum Jump:


Users browsing this thread: 1 Guest(s)