Our application has a functionality to auto-fill the Shipping Address and Billing Address based on the Initial Entry in the Address field by User. I was searching this forum and found out there isn’t much success in terms of handlign that Autofill. If I am wrong here please help me in figuring out how to handle that AutoFill. Here is my detailed requirement about that autofill and how I am planning to use that.
Once the user is on the Checkout page where they are supposed to enter there Shipping address and on Address Feild when they start typing there address Google throws some suggestions. I want to select the select the first given suggestion.
On the address field Step, the script will add a random number between 1 to 9999 and based on that number Google autofill will throw suggestions. I would like to select the 1st entry in suggestion.
This would make my test cases more dynamic in terms of test data. Currently, I am just pushing one single address in every test case.
If you can simulate the user action (Using Javascript or WebUI keyword) that triggers such a pop-up or auto-fill, then it may be possible to automate it. Could you try it out and report where you get stuck ?
It’s hard to come up with things from scratch, so you need to try it out first and let us see the difficulties.
I took your advice and actually tried by myself and it worked. Before this, I was just taking into consideration that I won’t be able to do it myself.
I created an object and used default click which is basically clicking on the very 1st suggestion given by Google. A step before that is adding a random 4 digit number to trigger Google Suggestion. This way now I don’t have to hardcode any address. Every test will generate a random address.
Hi @manpreet.mukkar
In my web app to select city, google API is integrated and I am trying to automate that using katalon but after auto-populates of location when I pick up one location it is not selecting. Can you please explain how you solved your issue
@manasa2 Once the Suggestions are triggered based on your input in the field then you need to capture the selector for 1st suggestion.That selector needs to be added using the click command.
You would need to capture the suggestion selector manually for 1st time and add that to object.
That would basically simulate the click on Google Suggestion.
Something like this :
int Google_Suggestion = ((org.apache.commons.lang.RandomStringUtils.randomNumeric(9999)) as int)
WebUI.sendKeys(findTestObject('Customer_Information_Page/Field_Address'), Google_Suggestion)
WebUI.delay(GlobalVariable.MediumDelay)
WebUI.click(findTestObject('Customer_Information_Page/Selecting_Google_Autofill_Suggestion'), FailureHandling.STOP_ON_FAILURE)
You will see in the script I am generating a 4 digit random integer that would be entered in the Autofill field. This would trigger Google suggestion.