Showing results for 
Search instead for 
Did you mean: 

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

Regular Contributor

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

props = Array("tagName", "idStr")
values = Array("a","showMore")
Show_More_Link = page.FindAll(props, values, 10)
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

Community Hero

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



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 ( for more details)

  /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.
New Here?
Join us and watch the welcome video:
Top Kudoed Authors