Hi, Complete Newbie, hope you can help. I have created a Test Case that uses a csv as source for populating a form on a web page. The case runs ok but it appears that no data gets entered into the form. Not sure now what I need to do. Attached my test case for reference.
You do not have any statements that will enter text. All you have are clicks
and pauses
. You need to have statements that will enter text, like: sendKeys
.
You target web page seems to have id attributes with varying value:
id=name-yui-3_17_2_1_1725798946806_2465-fname-field
Please check if the value of id attributes are static or change every time you queried the page.
If the id values change, it is quite often the case. Don’t get worried.
In order to support the web pages with varying id values, you need to do a trick to make locators (id=xxxxxxxx) can match with the varying id attributes.
A possible locator could be:
xpath=//*[contains(@id,'name-ui-3_17_2_1_') and contains(@id, '-fname-field')]
or
xpath=//*[contains(@id,'name-ui-') and contains(@id, '-fname-field')]
These locators intend to ignore the varying part.
I have added the sendKeys. It runs and I can see the correct text appearing on the form BUT when it submits the form errors as it doesnt see the text in the email field, the form thinks it is blank.
I expect it is something simple but beyond me…
can you share the source code of email field?
Hi, I have just checked and they remain static.
You wrote in your test:
click | id=name-yui-3_17_2_1_1725798946806_2465-fname-field | label=${FirstName}
I think the click command of Katalon Recorder accepts only one arguemnt = the 2nd column. It does not expect the 3rd column to have any value.
But you wrote label=${FirstName}
in the 3rd column.
Possibly, the label=${FirstName}
was just ignored, it made no effect.
I do not see what you intended with label=${FirstName}
. I suppose you inteded something with label=${FirstName}
, but you failed to express it properly.
Please learn and think more and change your code.
If you read the first link that I provided, the OP of that question had the same issue as you. In that instance, he had to use another statement to enter the text and it was suggested he use: setText
(it reads like setText was improved in some manner) instead of sendKeys
. Perhaps you can read the other OP’s link and review that.
Hi, I have updated the original Test Case and have tried both setText and sendKeys but to no avail. I have even tried using a fixed email address rather than looking it up from the .csv
All I get is the form returning the error that email is required.
It now looks like this:
does inputting email manually works on your AUT?
I have tried modifying the test case so that it doesnt populate the email field or the submit button. Once the script has run I then enter the email and at that point the rest of the populated fields appear to get cleared.
I think it is something to do with the way the page is built. If you want to take a look at the page itself and inspect the code feel free. It is : Contact — The Soul Shed | Alton
Many thanks for the help