1
votes

I am writing auto test scripts in QTP (UFT).

I have multiple columns in an external datasheet which could contain data or be blank. I was trying write some code, that if it was blank to click a submit button, if not blank then add in the fields. Please see code below:

If IsNull(DataTable("Available_Qualifications_1", dtLocalSheet)) = False then 
    Browser("Create Qualification Types").Page("Create Qualification Types").WebList("qavailable").Select DataTable("Available_Qualifications_1", dtLocalSheet)
    Browser("Create Qualification Types").Page("Create Qualification Types").Link("Add Qualifications").Click

ElseIf IsNull(DataTable("Available_Qualifications_1", dtLocalSheet)) then  
    Browser("Create Qualification Types").Page("Create Qualification Types").WebButton("Submit").Click
End if

However, I receive the error below:

Cannot identify the specified item of the qavailable object. Confirm that the specified item is included in the object's item collection.

Line (16): "Browser("Create Qualification Types").Page("Create Qualification Types").WebList("qavailable").Select DataTable("Available_Qualifications_1", dtLocalSheet)".

1

1 Answers

0
votes

What UFT is saying is that you're trying to set a value into the WebList which isn't one of the WebList's options.

Try outputing the value to see if UFT is correct, if it is then correct your test (by entering the correct values in the data table). If it's not correct you can try using the index by using the Select "#3" syntax (and report the problem to HP's support).