Function extractData

  • set element property

    Parameters

    Returns Promise<Result>

    Example


    xPath selectors should start from //

    const listOfSelectors: Data[] = [
    {
    name: 'button text',
    selector: '#sysverb_new',
    type: 'block',
    },
    {
    name: 'dropdown value',
    selector: '#cd2f29a1db502010cab3a455ca961989_select',
    type: 'select',
    },
    {
    name: 'text',
    selector: '#sysverb_new',
    elementHandleFunc: async () => 'example',
    type: 'block',
    },
    {
    name: 'Xpath selector',
    selector: '//*[@id="sysverb_new"]',
    type: 'block',
    },
    {
    name: 'checkbox name',
    selector: '#check_incident_552c48888c033300964f4932b03eb092',
    type: 'checkBox',
    },
    ];

    const result = await extractData(ctx, listOfSelectors);
    @expected result {
    "button text" : "Submit",
    "dropdown value": "3",
    "text": "example",
    "Xpath selector": "some text",
    "checkbox name": "some text"
    }

Generated using TypeDoc