get Response header - wait until state is SUCCESS

36 views
Skip to first unread message

garvitag...@gmail.com

unread,
Mar 15, 2018, 1:10:24 AM3/15/18
to Selenium Users
Hi,

Is there any way i can get data from response header after button click and wait until state = SUCCESS. I found that can be accomplished using RestAssured , i tried running that like following: 

RestAssured.baseURI = "http://restapi.demoqa.com/utilities/";
 
RequestSpecification httpRequest = RestAssured.given();
 
Response response = httpRequest.request(Method.GET, "/Hyderabad");
 
String responseBody = response.getBody().asString();

It takes URL everytime, my scenario is i need to get response after click and url is not hit everytime. Is there any way to accomplish that ?

My requirement is to simply wait after button click so that my chart is rendered. I have tried :
1. explicit wait for UI element like loader (did not work on CI as it takes very few ms to appear and disappear so its not consistent)
2. explicit wait until an element appears after chart is rendered - did not work because if i change parameters , all elements are already present like x-axis and y-axis. elements updated so wait fails until visibility of elements.
3. wait till ajax is completed - failed because that that ajax calls another process to start.
4. setScriptTimeout() - fail 
5. wait until JS load - wait until document.ready = complete : fail because page is not refreshed, only chart is rendered again 
6. tried analyzing html, if any element is added or deleted, Nothing like that happens. Only chart gets refreshed and data is updated.

Can anyone help me solving this , is there any other way i can try?

Note: I can not share relevant html, its restricted. I have attached network snapshot just for reference to capture what happens after button click.

Thanks !!
networ.PNG

Krishnan Mahadevan

unread,
Mar 19, 2018, 2:01:32 AM3/19/18
to seleniu...@googlegroups.com

You can make use of a Proxy server such as BrowserMobProxy and then retrieve this information via BMP.

 

For learning how to work with BMP, please refer to the documentation here: https://github.com/lightbody/browsermob-proxy/blob/master/README.md

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/


Reply-To: <seleniu...@googlegroups.com>
Date: Thursday, March 15, 2018 at 10:40 AM
To: Selenium Users <seleniu...@googlegroups.com>
Subject: [selenium-users] get Response header - wait until state is SUCCESS

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
selenium-user...@googlegroups.com.
To post to this group, send email to
seleniu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/4b06c36a-d682-48ae-9f92-ca07475d6617%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages