Clicking on same element gives error in for each loop

I have to search multiple users in facebook. Steps are:

  1. Login
  2. Search Candidate
  3. click on ‘People’ link to see all available users
  4. Click Home
    I have used for each loop. For first loop, robot clicks the ‘People’ button but in second loop it throws error “Click ‘DIV’ : Cannot find the UI element corresponding to this selector: ”. Please help.

Whats the selector that you are using to click on that the ‘People’ tab? It looks like its changing everytime you navigate to other page and come back. You need to make sure that its dynamic enough to handle all cases.

To start with, capture the selector for few instances of the ‘People’ tab and cross verify the attributes that is changing. Basically there may be some attributes like ‘parentid’ which are not always dynamic and generates some random number. Using ‘aaname’ property is the best approach for these cases along with some other properties that are stable.

Let me know if it helps.

Rammohan B.

This is the selector I get:

“webctrl aaname=‘People’ idx=‘1’ parentid=‘u_jsonp_3_1’ tag=‘DIV’ />”

Removing the idx, parentid, tag also does not work.

This one works for me,

<html app='chrome.exe' title='*Facebook Search' />
<webctrl aaname='People' tag='DIV' />

Rammohan B.

This is working. Thank you so much.

1 Like