cancel
Showing results for 
Search instead for 
Did you mean: 

Subscript out of range: '[number: 0]'

Highlighted
Regular Contributor

Subscript out of range: '[number: 0]'

props = Array("tagName", "idStr")
values = Array("a","showMore")
Show_More_Link = page.FindAll(props, values, 10)
Delay(10000)
Show_More_Link(0).Click                    'Click on show more link to check existing users

But after Click, It only giver problem in Internet Explorer 11. Below is the error shown in test log
Subscript out of range: '[number: 0]' 

How to fix this problem

1 REPLY 1
Highlighted
Community Hero

Re: Subscript out of range: '[number: 0]'

Hi,

 

The error may mean that either

a) the link was not found or that

b) the result array was not converted for JScript/JavaScript code.

 

For the case a) - can you confirm with the ObjectBrowser that the sought for link does exist? Note, .FindAll() result will be 'visually reverted', i.e. the first element of the array will reference the last sought for element on the screen. Note2, in case you don't need to search for all links on the page, there is no reason to use .FindAll() because of performance considerations. .Find()/.FindChild() is much better in this case.

 

For the case b) - if your test code is in JScript/JavaScript, the resulted array must be converted to the JScript array format (https://support.smartbear.com/testcomplete/docs/scripting/specifics/jscript.html#arrays for more details)

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors