Ask a Question

How can we use OpenShift in Ready API?

avidCoder
Super Contributor

How can we use OpenShift in Ready API?

There is a scenario where I need to login to particular server of Open Shift using code and fetch the logs (SOAP response) from there. Can we do it using Java or Groovy? Any code help will suffice.

11 REPLIES 11
groovyguy
Champion Level 0

Unfortunately I've never found an easy way to do this with groovy. If I understand correctly, you need a way to access/login to the OpenShift server and transfer files/logs from the server to your ReadyAPI client? Does that sound close to what you want to do?




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!

Yes absolutely correct @groovyguy . Is there any way we can do this? Else I need to opt for another approach.

@avidCoder: Are the log files available through an HTTP / HTTPS / FTP webserver? If so, that may be doable with either an FTP test step, or a groovy script. If they are available through a network share, that might work too. 

 

If the files are not available through such an interface and if you do truly need to log into a server and manually download/copy the files, then I am not sure there's much that can be done even with groovy. Can you elaborate and provide the detailed steps you would need to mimic? How would you do this process manually?




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!

Manually, I'd login to OpenShift server with username and password. Once it is logged in properly, I'd go to the application and click on the logs link. Here we can see the logs for the services. From here, I need to get the SOAP response and that's all. This thing I want to automate through Java/Groovy.

 

After I hit the REST request, I will get the REST response in JSON format, Next testStep I will add as "validateXML" . Here, I'd write the code for all the connection of OpenShift.

 

So, What is happening here is, I am hitting the REST service and getting the JSON response and once I get this, I need to verify the same from OpenShift which has SOAP response. And all the tags will be different here. So, By any way I get the logs, I will take put the SOAP response out of it and then will MAP JSON object with XML tags. And we are done.

Okay, I am tracking what you are saying but I need a bit more information. Please bear with me, but I need you to be as detailed as you can telling me how you login to the OpenShift server.


Is this a webpage that you go to to see the logs? Do you RDP to the OpenShift server? Do you SSH? How/what application do you use to access the OpenShift server?




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!

This is kind of server, you can say.. for which we have URL for different environment. And to access this URL we require client SSL certificate. Just we need to navigate to that URL through browser and enter the user/pass for the environment I am accessing.  RDP is not at all required. we can access it on local but certificate is required.

Since it's browser based, you could potentially use a Selenium driver in a groovy script and automate browsing to the webpage that way. It's been done and there's been a number of guides posted here on the forums and across the web. Here's a few examples:

 

https://gist.github.com/bensullivan/4631660

https://support.smartbear.com/readyapi/docs/testing/integrations/selenium/about.html




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
sanj
Super Contributor

I have done a few code of selenium using groovy.

The other option which may be better is to have all your libraries coded in java and have a groovy code running in READY API which calls these java libraries

 Your selenium code can be done in java

I find this way its easier to reuse code for different tcs

This is what I have thought of as my final try. But before that i'd like to work on fetching this using codes.. Anyway, thanks for the reply.

cancel
Showing results for 
Search instead for 
Did you mean: