Click on Javascript notification using Selenium IDE not working

455 views Asked by At

Below is HTML code,

<div role="alert" name="notification_actions" style="font-size:13px;" class="alert-action alert-info notify_actions text">
   <a href="#"></a><a data-dismiss="alert" id="18" class="close remove_notify">×</a>
   <div class="row share-notify">
      <p>testuser has shared his profile with you.</p>
      <div>
         <a data-status="A" data-user_id="7" data-with_user="10" class="badge share-request" href="#">Accept</a>
         <a class="badge share-request" data-status="D" data-user_id="7" data-with_user="10" href="#">Decline</a>
      </div>
   </div>
</div>

Code used:

waitForElementPresent

css=div[name="notification_actions"]

click xpath=.//*[@id='my-notification']/div/div/div/div/a1

Note: On Clicking the Accept button an Ajax call is working behind.

Update:

I am able to click on Accept button it is found behaving different.I have a verification after I click on this accept button that name of user should be displayed in left side bar under a menu. This flow is found not working only while I automate and no issue if done manually.

Screen shot

1

There are 1 answers

3
Zeeshan S. On

When executing waitForElementPresent command using css Locator, the syntax is:

css=tag[attribute=value]

Next use link Locator to click on 'Accept' or 'Decline' links.

So in this case; when executing waitForElementPresent command use css=div[name=notification_actions].

When executing click command on 'Accept' or 'Decline' links, use:

link=Accept

or

link=Decline