Conversation
|
@leehuwuj is attempting to deploy a commit to the marcusschiesser's projects team on Vercel, but is not a member of this team. To resolve this issue, you can:
To read more about collaboration on Vercel, click here. |
| * @param dom - The DOM to construct the input tree from | ||
| * @returns The input tree | ||
| */ | ||
| export function programmaticGetFormTree(dom: Document): string { |
There was a problem hiding this comment.
What is this?
I started with programmatic way which using code to construct a form tree above. It works with normal cases but also have trouble on constructing the element label with a complex form code where the text label is at other element.
To resolve this, check the getFormNode() function below
| * @param value - The value to set | ||
| * @returns true if value was set successfully, false otherwise | ||
| */ | ||
| export function inputFormValue(xpath: string, value: string): boolean { |
There was a problem hiding this comment.
Do the input task, doesn't work with selector, radio elements at the moment
| value: string; | ||
| } | ||
|
|
||
| class FormPrefillWorkflow { |
There was a problem hiding this comment.
Sorry, i just reused the skeleton from our navigation tool, it could include unnecessary/dead code.
There was a problem hiding this comment.
The idea is:
- Construct a form tree - the purpose is to reduce the dom size, construct a contextual information of the form elements along with a xpath - to reduce the issue on predicting a wrong xpath.
- Predict the needed fields and their values.
- Input the fields.
- Submit the form - but doesn't work now. please ignore this.
Test case: https://docs.google.com/forms/d/e/1FAIpQLSf7zWsJkIEX_uTSvx-PUtEdrROmoXMbEZ76wzh7ZmbK5fo78w/viewform
Context data:
Expectation: