Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select case is not being executed in a Function
#1
Solved: 6 Years, 6 Months ago
Hi I have this below code where everything else in the function works fine except for the Select case. The select case is not even being executed. It executes till the if statement and then exists the function. does not throw any error or anything. Can someone tell What am I doing wrong.

Code:
Function Submit_Wirelog(SelectSubmitOrCancel)
    Dim funcName : funcName = "Submit"        
    Dim setupFuncName : setupFuncName =   "SETUP|" & funcName

    
    If Browser("Browser").Page("Pge").WebElement("Ele").ExistsAbort (10) Then
        Select Case ucase(SelectSubmitOrCancel)
            Case "Submit"
                Browser("Browser").Page("Pge").WebButton("Btn").ClickAbort (20)
                Created =Browser("Browser").Page("Pge").WebElement("LblLogNumber").GetROProperty("innertext")
            Case "Cancel"
                Select Case ucase(parameter.Item("SubmitYesorNo"))
                        Case "YES"
                            msgbox "Cacelled"
                        Case "NO"
                            msgbox "NO"
                End Select
        End Select
    else
        ResultOutput "Pass", "Expected:Verified and created wireLog"&vbnewline,"Actual:Done Successfully"        
    End If    
    
End Function
Reply
#2
Solved: 6 Years, 6 Months ago
Solved it. Since I used the ucase for switch statement the Case values should be in upper case like below. Not deleting this post as it be useful for someone else.
Code:
Select Case ucase(SelectSubmitOrCancel)
            Case "SUBMIT"
                
                    Case "CANCEL"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Range in Select Case Statement Studymode 0 1,502 12-14-2017, 06:18 PM
Last Post: Studymode
  Using Select Case Statement Studymode 0 11,709 12-13-2017, 05:55 AM
Last Post: Studymode
  Calling a function in a Test Script from a function library anupam4j 3 6,115 06-26-2015, 12:31 AM
Last Post: babu123
  Case changes while reading values from inbuilt datatables krishnakittu03 3 2,967 04-28-2015, 11:34 AM
Last Post: kbhargava505
  Webelement innertext is not case sensitive san4hex 7 6,236 05-13-2013, 02:59 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)