cancel
Showing results for 
Search instead for 
Did you mean: 

Execution of complete test case having different test steps without manual interference.

SOLVED
Highlighted
Contributor

Execution of complete test case having different test steps without manual interference.

Hi,

 

I want to run my test suites for the regression. 

 

There are test cases where it has multiple steps. And in the mid steps, it has to create access tokens and pass it in the headers which I'm doing it by manually interfering in it. How can I do it? I tried automating that step, but I did not succeed in it.

 

Thanks and Regards,

Jagruti Wani

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Execution of complete test case having different test steps without manual interference.

Hi @sonya_m ,

 

Actually, I had already raised a support ticket and it was getting much delayed so I thought of taking help from you. But then @KirillZakharov came to rescue. Let me describe the solution-

The code was correct.

It is just that I had to add that code on the Consent screen and not on the login screen.

Please find the attached screenshot.

Jagruuti_0-1596620523505.png

 

 

 

 

 

View solution in original post

8 REPLIES 8
Highlighted
Community Leader

Re: Execution of complete test case having different test steps without manual interference.

@Jagruuti :

 

Could you please let me know how that token is getting generating you are hitting any other API for the same or what method you are using.


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Contributor

Re: Execution of complete test case having different test steps without manual interference.

Hi @HimanshuTayal ,

 

I'm using OAuth 2.0 for generating the Access token.

You can get an idea by having a look at the attached screenshot. 

I'm clicking on the Get Access Token button to generate it.

 

Thanks in advance 

    Jagruuti 

Highlighted
Community Leader

Re: Execution of complete test case having different test steps without manual interference.

@Jagruuti :

 

You can refer below link on how to access OAuth2.0 Grant with groovy Script:

 

oauth2 tutorial


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Contributor

Re: Execution of complete test case having different test steps without manual interference.

Hi @HimanshuTayal ,

 

I'm referring this link-https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/automate/sample.html

For the login page:

 

I tried using the below code:

 

//// This script checks what page is displayed and provides the appropriate data. It uses the project-level "user" and "pass" properties.
if (document.getElementById('username') && document.getElementById('Login')) {
document.getElementById('username').value = "jagruti.wani@********dev";
document.getElementById('password').value = "********";
document.getElementById('Login').click();
}

 When I try to run the script, it works and the application gets open, but it does not fill the user and password information on the application's page.

Just the login page gets open as shown in the attached screenshot.

 It does not fill the password. But when I close the page, I get 'All scripts executed successfully' pop-up as shown in the attached screenshot.

 

Thank you in advance,

  Jagruuti Wani

 

Highlighted
Contributor

Re: Execution of complete test case having different test steps without manual interference.

Hi @sonya_m,

 

Can you please help me to get an answer to this question?

 

Thanks and Regards,

Jagruuti

Highlighted
Community Manager

Re: Execution of complete test case having different test steps without manual interference.

Hi @Jagruuti , our Customer Care engineers will be able to provide you with a solution faster in this case since this situation requires a deep investigation! 

Please raise a support ticket here and it would be great if you could share the solution here when you receive it. Thank you!


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Contributor

Re: Execution of complete test case having different test steps without manual interference.

Hi @sonya_m ,

 

Actually, I had already raised a support ticket and it was getting much delayed so I thought of taking help from you. But then @KirillZakharov came to rescue. Let me describe the solution-

The code was correct.

It is just that I had to add that code on the Consent screen and not on the login screen.

Please find the attached screenshot.

Jagruuti_0-1596620523505.png

 

 

 

 

 

View solution in original post

Highlighted
Community Manager

Re: Execution of complete test case having different test steps without manual interference.

Hi @Jagruuti ! Thank you for returning to the thread and posting the solution.

Kudos to Kirill🙂


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors