Forum Discussion
Well, the second block of code you are explicitly setting the value so the case statement doesn't really matter if it works correctly or not.
So... the question is, when you set your breakpoint on your first block of code at the beginning of the case statement, if you bring up a Watch window on varsp1, what is the value?
Keep in mind that the case statement is looking at the value of that parameter and attempting to compare it to a string of 'CBOSabreID0'. If the string is not an EXACT match, the case will never trigger. Additionally, if varsp1 doesn't actually CONTAIN a string, the case will never trigger. So... best debugging is to figure out what is being passed in and determine if the case you have defined is actually being met.
Hi,
I think i did that:
GetCBOProfileSabreProfileID(CBOSabreID0);
Thanks,
Kim
- tristaanogre6 years agoEsteemed Contributor
Nope. That passes in some unknown identifier CBOSabreID0. You want to pass in a string. So, it needs to read
GetCBOProfileSabreProfileID('CBOSabreID0');
Note the inclusion of the quotes indicating that what you're passing in is a string. Again, the non-strict typing of JavaScript got you... you can create identifiers on the fly just simply by using them. So, you had created an identifier of CBOSabreID0 that was empty and didn't actually contain the desired string.
EDIT: Sorry, not JavaScript... DelphiScript. But the same thing applies. DelphiScript is not strongly typed either so it allows you do do some odd things with creating variables that can contain different values.
- kimmatsumoto6 years agoContributor
GetCBOProfileSabreProfileID('CBOSabreID0');
I tried the above but results was the same.
- kimmatsumoto6 years agoContributor
This is a similar procedure which works:
procedure Verify_Traveler_SabreProfileID(var1);
var
page, obj;
begin
page := Sys.Browser('*').Page(EnvironmentSettings2.GetServerURL + '*');
obj := GetNativeWebObject(page, 'id', 'sabreProfileID');
obj.ScrollIntoView(false);
//Verify Sabre Profile ID
case var1 of
'CBOSabreID0':
begin
aqObject.CheckProperty(obj, 'innerText', cmpEqual, ProjectSuite.Variables.CBOSabreID0);
end;end;
end;
Used as: Verify_Traveler_SabreProfileID(CBOSabreID0);
Related Content
Recent Discussions
- 16 hours agotramuntana
- 3 days agoSlickRick