Some API's are failing with TestCafe framework due to which data is not rendering on UI - node.js

I am using testcafe with typescript to automate the CRM application .At one point when i click on a button it is redirecting me to a new page where we have multiple API calls which renders data on UI .One API is failing everytime with automation whereas it is passing with manual.I connected with one of the developer and he confirm that data is being returned via the AJAX call. However the TestCafe test-framework proxy called hammerhead.js is throwing an exception with the message :
ERR_EMPTY_RESPONSE. I have tried everything i.e timeout , ajax timeout , hard wait but didn't get anything fruitful.
Network response
Data is not populating underUpdates from portal whereas it is working fine with rest other section as mentioned in picture

Related

(failed)net::ERR_CERT_AUTHORITY_INVALID when using fetch api in Chrome extension service worker

We are migrating our chrome extension from Manifest V2 to V3. In this process we removed JQuery AJAX requests and started using fetch API in the background page for sending REST API requests to the server. When sending the requests, the first 2 to 3 requests will get a response but after that the requests are failing. It is throwing (failed)net::ERR_CERT_COMMON_NAME_INVALID error.
The API requests works fine when using the Jquery AJAX calls.
API calls in the network tab
Details about the server :
The server is installed in my machine only. I am accessing the server through localhost. When we access the server for the first time in a browser a warning page will be shown. We have to click proceed to access the website. Normally the Jquery AJAX requests works fine once we click the proceed option.
Server warning page
I tried giving different header options in the fetch API, but the result was still same.
How do I resolve this fetch API error ?

In NightwatchJS how do I make a synchronous DB call and make Nightwatch wait for the response before moving on

I have a NightwatchJS test that requires a MSSQL Db call to complete before moving on to then verify the results of that db call. The test is 2 parts.
Part 1 fills out a form and submits it into our website and verifies via API in our CMS that the form successfully posted and saves the Guid in a table in another db specifically for Nightwatch testing for verification later.
Part 2 runs later in the day to allow another internal process to 'ingest' that form into a different department's db and return the ingestion results into our CMS for that form. Part 2 then needs to do a Db lookup into the Nightwatch db and get all Guids that happened in the last 24 hours and hit another API endpoint in our CMS to verify ingestion of that form occurred into that other department by checking a field that the other department's process updates on ingestion.
I had the same issue of waiting-to-complete with the API calls where I needed NightwatchJS to wait for the API call to complete in order to use the results in the assertion. To solve that, I used a synchronous http library called 'sync-request'. So, that part works fine.
However, I cannot seem to find a synchronous Db library that works in Nightwatch's world.
I am currently using 'tedious' as my Db library but there is no mechanism for awaiting. I tried promises and async/await to no avail since the async stuff is wrapped inside the library.
I tried Co-mssql but I keep getting an error
TypeError: co(...) is not a function
using their exact example code...
Any ideas or suggestions?
Any other synchronous MSSQL libraries that work in NightwatchJS?
Any way of using 'tedious' is a fashiopn that ensures await-ability?
I found a library called sync-request that blocks the thread which is what i need.

Unable to log in to Azure web app via VS2015 web performance test

How do I correctly handle the login/authentication scenario for an Azure web app in my VS2015 web performance test?
I created an XML file as a data source for the WAAD username and password. I bind the username and password to the Form Post Parameters: login and passwd respectively at request: https://login.microsoftonline.com/xxxx/login
But when I run the test, the Web Browser tab shows this error:
We can't sign you in
Your browser is currently set to block JavaScript. You need to allow
JavaScript to use this service.
To learn how to allow JavaScript or to find out whether your browser
supports JavaScript, check the online help in your web browser.
I also get a number of errors like this:
The value of the ExpectedResponseUrl property
Validation xxxx.azurewebsites.net/xxxx/docs/xxxx.aspx does
not equal the actual response URL
login.microsoftonline.com/xxxx/wsfed. QueryString
parameters were ignored.
Any idea how I can successfully log in to the Azure web app via the web performance test?
There are several methods of login and authentication that can be used. Just binding values to form post parameters may not be sufficient or correct. You will find the login form has hidden session identities that must be passed as well as the login data. I find that recording a test two times using as nearly as possible the same inputs and doing the same activities helps. These two tests can then be compared to find the dynamic data that needs to be handled.
In a comment the questioner added "I noticed these parameters, n1-43 are different but I have no idea what they represent. How do I handle them?". I can have no idea what they represent as I do not know the website you are testing. You could ask the website developers. Or, better, treat them as dynamic data. Find where the values come from, save them into context variables and use them as needed. This is basic web test development. Here and here are two good articles on what to do.
The message about JavaScript not being supported can be ignored. Visual Studio web tests do not support JavaScript or any other "active" parts of a web page, they only support the html part. Your job as a tester is to simulate what the JavaScript does for the specific user journeys you are testing. That simulation is generally just filling in the correct values (via context parameters) in the recorded requests.
Unexpected response urls can be due to earlier failures, such as teh login not working. I suggest not worrying about them until all of the other test problems are solved. Then, if you need help ask another new question.

Error when combining authenticated and anonymous access to one database

I have existing Xpages app for authenticated users only. Now I need to create a two new Xpages and allow annonymous access to them. To do this I added 'Read Public Access documents' do Anonymous user. Now I can see these 2 Xpages anonymously but sudenly existing non-anonymous part of application doesnt work anymore and app raises Dojo errors in browser as below. Scenario is like this:
Tested on Domino 9.01 and 9.0.1FP3 + Chrome with the same results
I open non-anonymous app in browser and authenticate, it works
correctly for now
from different browser I open the anonymous Xpage that works fine
also
now I refresh (F5 in browser) the non-anonymus app from point a) and it starts raise errors as below. I need to restart http to fix it.
I tested this scenario several times on my local and customers server with the same result. I found this http://www-01.ibm.com/support/docview.wss?uid=swg1LO76577 ... but is there any workaround for this scenario? Or how to combine anonymous and authenticated access in one app properly?
XHR finished loading: GET "http://localhost:8090/xsp/.ibmxspres/dojoroot-1.8.3/dojo/require.js"
XHR finished loading: GET "http://localhost:8090/xsp/.ibmxspres/dojoroot-1.8.3/ibm/xsp/widget/layout/layers/nls/xspClientDojo_cs.js".
dojo.js:15 Uncaught TypeError: Cannot read property 'dynamic' of undefined_bc # dojo.js:15_31 # dojo.js:15_f4 # dojo.js:15def # dojo.js:15(anonymous function) # xspClientDojo.js:5
That technote sounds wrong. I've had anonymous and authenticated access in an NSF running fine in production for many years, first deployed on 8.5.1.
My XPage is public access, but the custom control for the layout isn't.
I can't see how point 2 (another user opening on another browser) can impact it.
Based on the word "dynamic" in the error, do you have a dynamic content control in the relevant page? If you're on the same page when you authenticate, I would look at the code running after authentication and whether that changes JS variables or the component tree which means something is then not available to code running on load of the page.

Why do multiple requests to ServiceStack http handlers fail?

I've verified this behavior with multiple projects, including the Windows Service AppHost Starter Template example project (unmodified). Initial requests succeed and display the default TODO page, but subsequent requests never complete.
It's simple to reproduce this scenario. Just perform the first request to http://localhost:83. You'll see the default TODO page render fine. Now hit "refresh" in the browser and you should now see the request never come through. If running in debug mode through VS, you'll see ObjectDisposedExceptions in the Output window.
Is there a problem with the latest ServiceStack codebase?
There was an issue in the response stream not being closed properly.
Should now be fixed in the latest version. Can you try again with the latest version v3.07, either on:
https://github.com/ServiceStack/ServiceStack.Examples/downloads
https://github.com/ServiceStack/ServiceStack/downloads
or 'ServiceStack' on NuGet.

Resources