Ask a Question

How to automate Sorting Functionality in Web App with Java Script

dikshika114
Contributor

How to automate Sorting Functionality in Web App with Java Script

How to automate Sorting Functionality in Web App with Java Script?

Please refer screenshot to share the script related to sorting.

dikshika114_0-1646642356095.png

 

4 REPLIES 4
ebarbera
Staff

Hello @dikshika114 - 

 

Im not sure what you are looking to accomplish here - you would like to click the arrow to sort the data?


Thanks,

Emma

Hi @ebarbera . Yeah i want to check the data is sorted or not , when we click on the arrow.

Steps:

1. Click on Arrow which can be Ascending or Descending.

2. On the basis of clicked arrow, we will get all the data in array from all the rows. (Actual)

3. We will sort (Ascending or Descending) the data and put it into the other array. (Expected)

4. Then we will compare the Actual and Expected output in the rows. If it will match, then we will pass the

test case like it's sorted in Asc or Dsc. Otherwise the test case will fail.

 

Can you please provide the script for that part. I am using JavaScript for my project

Hi @dikshika114 - 

 

It is not really possible to provide a script without having access to the application. Are you recording into scripts or just writing them?

 

Also, at which point in the numbered steps are you getting stuck?

 

Thanks, 

 

Emma

Hey @ebarbera 

 
Just provide me the information like, 
1. how can we add the items in the array? Please provide the line of code for that.
2. How can we define the array? Please provide the line of code for that.
Because when I am using arr.add(S1); it's not working for me....
3. What is the automatic way in test complete to sort the record which is in array.
Like when I tried array.sort(); it's not working in testComplete.
 
Thanks
cancel
Showing results for 
Search instead for 
Did you mean: