# How to click on response body link (that keeps changing) and verify that Id = Global Admin exists within the link?

**URL:** <https://community.postman.com/t/how-to-click-on-response-body-link-that-keeps-changing-and-verify-that-id-global-admin-exists-within-the-link/15773>\
**Category:** Help Hub\
**Created:** [September 10, 2020, 10:19pm UTC](https://community.postman.com/t/how-to-click-on-response-body-link-that-keeps-changing-and-verify-that-id-global-admin-exists-within-the-link/15773 "2020-09-10T22:19:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahbaz.shiekhqa](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@shahbaz.shiekhqa](https://community.postman.com/u/shahbaz.shiekhqa)\
**Post date:** [September 10, 2020, 10:19pm UTC](https://community.postman.com/t/how-to-click-on-response-body-link-that-keeps-changing-and-verify-that-id-global-admin-exists-within-the-link/15773/1 "2020-09-10T22:19:52Z")

</div>

Hi,

I have the following url below, but for my test i want to click on it and check if the url has Global Admin as a User Role.

API1 =

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/4/f/4f56b36d984b3591b5c48eab78e42a437786e182.png)

Click on the link (which is always changing after every send)

and verify once you send the url - User Role = Global Admin …  
I want to be able to do this in the test scripts of the first api call … is this possible?

I am already sending the request for that url and it is coming up as pass, but what would be next…

```auto
postman.setEnvironmentVariable("UserAdminUrl", pm.response.text());

var UserAdminUrl = pm.environment.get("UserAdminUrl");

pm.test("Expecting Response to have text Url",function (){
    pm.expect(pm.response.text()).to.include(UserAdminUrl);
});

pm.test("UserAdminUrl hits the server successfully", function () {

    pm.sendRequest(UserAdminUrl, function (err,response){
        pm.expect(err).to.not.be.ok;
        pm.expect(response).to.have.property('code', 200);
        pm.expect(response).to.have.property('status', 'OK');
    });
});

```

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/b/5b5e41add8e24663a9d7f1866706eee1ec065df9.png)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 11, 2020, 10:33am UTC](https://community.postman.com/t/how-to-click-on-response-body-link-that-keeps-changing-and-verify-that-id-global-admin-exists-within-the-link/15773/2 "2020-09-11T10:33:08Z")

</div>

Hey @shahbaz.shiekhqa

Would something quick like this work for you?

```auto
pm.test("UserAdminUrl hits the server successfully", function () {
    pm.sendRequest(UserAdminUrl, function (err, response){
        pm.expect(response).to.have.property('code', 200);
        pm.expect(response).to.have.property('status', 'OK');
        pm.expect(response.text()).to.include('Global Admin')
    });
});

```

It looks like the response is HTML so to extract that exact point in the response, would be slightly trickier but not impossible.

---

<div class="post-metadata">

**Author:** ![shahbaz.shiekhqa](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@shahbaz.shiekhqa](https://community.postman.com/u/shahbaz.shiekhqa)\
**Post date:** [September 11, 2020, 1:26pm UTC](https://community.postman.com/t/how-to-click-on-response-body-link-that-keeps-changing-and-verify-that-id-global-admin-exists-within-the-link/15773/3 "2020-09-11T13:26:56Z")

</div>

Thank you so much, that worked perfectly,  
i changed it to include the whole id and user role and global admin

```
pm.expect(response.text()).to.include('<span id="ctl00_RoleLbl"><b>User Role:</b> Global Admin</')

```

thanks 🙂
