Comparing object inner text to Excel data in VBScript using DDT Driver
The following script obtains the inner text of an object in a web application and checks to see if the contents are equal to a column in an Excel document. The driver script is where I'm using the DDT Driver to obtain the Excel values.
It's getting the values from both the application and Excel, but I get an error every time. I used msgbox to obtain the values of the two variables, and I put them into Beyond Compare to make sure the values are equal, and they are. Even though the values are equal, the script is still logging an error.
Any thoughts?
Function CodeVerify (chktext)
'Setting the drop down object
Set chkObj = Aliases.browser.ClassPage.ClassHeader.ClassBox.ClassInfo.ClassDropdown
'Obtaining the inner text of the drop down
chkTxt=chkObj.innerText
'Chktext is a variable that is passed when the script is run, this is the column in the Excel sheet where the drop down requirements are stored.
exptxt=chktext
'Exptxt should be the drop down requirements in the Excel Sheet and it should equal chkTxt.
If exptxt = chkTxt Then
Log.Checkpoint "Codes have been verified"
Else
Log.Error "Codes have not been verified"
End If
End Function