Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Results based on iteration
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
I need to test a wide range of items. One of which is to see if certain links are hidden from certain users. I currently have the test running on iterations based on username/login. Any items not present report a warning.

Is there a method to compare iteration with the current action/test and provide a pass/fail report depending on which iteration?
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Could you please provide some more information and whta exactly is the requirement.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
User A logs in, verify links A, B and C exist, if they exist run a test specific to that link.
If they don't exist report failed (but continue testing)

User B logs in, verify that links A, C exist and B does NOT exist. Run test on existing links.
If A,C do not exist report failed
If B does exist, report failed (and possibly do not run test)


Rather than making a seperate test for each user, I'd like to parameterize the user login/pw.

Here is my current code, though it doesn't do what I want. Only reports a warning if links don't exist.
Code:
If Browser("...").Page("...").Link("...").Exist (1) THEN
    Reporter.ReportEvent micPass, "...", "Pass"
    Browser("...").Page("...").Link("...").Click
    RunAction "...[...]", oneIteration    
    Else
    Reporter.ReportEvent micWarning, "...", "...does not exist"
End If
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
Find the attached document it might help u:
Let me know if I can help u further
.doc   learnqtp_links.doc (Size: 30 KB / Downloads: 98)

Regards,
Sankalp
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Unfortunately I'm not able to download .doc files
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago

.doc   learnqtp_links.doc (Size: 30 KB / Downloads: 77) [quote='joncfrazier' pid='20922' dateline='1336400614']
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
That's still a .doc file and I still can not download them (I'm behind a firewall that doesn't allow certain file types).

Anyway, I figured out the answer (I think):
Each link is done like this:
Code:
'before link these are added, where [linkname] is the term being defined for later (can be anything)
Iteration = DataTable.GlobalSheet.GetCurrentRow 'defines what Iteration is
If Browser("...").Page("...").Link("...").Exist (1) THEN [linkname] = True Else     [linkname] = False End if       'Defines a link true/false for quick referene later

'now for the link
If [linkname]= True Then
    If Iteration = 1 OR Iteration = 2 OR Iteration = 3 OR Iteration = 4 Then
        Reporter.ReportEvent micPass, "...", "Pass"
        Browser("...").Page("...").Link("...").Click
        RunAction "...", oneIteration
    ElseIf Iteration = 5 THEN
        Reporter.ReportEvent micFail, "...", "... exist for an invalid user"
    End If
End If

If [linkname]= False Then
    If  Iteration = 1 OR Iteration = 2 OR Iteration = 3 OR Iteration = 4 Then
        Reporter.ReportEvent micFail, "IQ24C", "IQ24C does not exist"
    ElseIf Iteration = 5 THEN
            Reporter.ReportEvent micPass, "...", "... does not exist"
    End If
End If

At least that's my theory, haven't tried it yet Smile Is there a more condensed way to do this? For several links this gets to be a long piece of code, though perhaps for my purpose it wouldn't make sense to shorten as each user (iteration) can contain different links.

edit: Previous code didn't actually solve anything and was just a rehash of what I previously did.
Reply
#8
Solved: 11 Years, 3 Months, 3 Weeks ago
Gud, finally u come across a solution. that's great.

Regards,
Sankalp
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object not found during the 2nd iteration of an Action call in a For loop BGunay 0 968 04-23-2020, 07:08 PM
Last Post: BGunay
  UFT Tool runs more than one iteration always cthossain 2 3,717 02-12-2017, 01:25 PM
Last Post: cthossain
  Function return value is not passed during the 3rd iteration premanand1979 0 2,253 10-16-2014, 09:40 PM
Last Post: premanand1979
  Iteration in Local sheets for UFT11.5 haithamQTP 1 3,192 02-27-2014, 09:12 AM
Last Post: supputuri
  Parameter iteration bistritapcv 1 3,394 03-28-2013, 10:40 AM
Last Post: Sathiya

Forum Jump:


Users browsing this thread: 1 Guest(s)