GetOptionAsync

Parent Previous Next

GetOptionAsync

Description: the method returns the index, text, or value of the selected option of the selected option from the select element

Syntax: GetOptionAsync(string by, string locator, string type)

Return value: string


Example:

FRAMEElement frame = await tester.GetFrameAsync(0);


string index = await frame.GetOptionAsync(Tester.BY_CSS, "#MySelect", FRAMEElement.BY_INDEX);

string value = await frame.GetOptionAsync(Tester.BY_CSS, "#MySelect", FRAMEElement.BY_VALUE);

string text = await frame.GetOptionAsync(Tester.BY_CSS, "#MySelect", FRAMEElement.BY_TEXT);


string index = await frame.GetOptionAsync(Tester.BY_XPATH, "//*[@id='MySelect']", FRAMEElement.BY_INDEX);

string value = await frame.GetOptionAsync(Tester.BY_XPATH, "//*[@id='MySelect']", FRAMEElement.BY_VALUE);

string text = await frame.GetOptionAsync(Tester.BY_XPATH, "//*[@id='MySelect']", FRAMEElement.BY_TEXT);

Created with the Personal Edition of HelpNDoc: Easily create Qt Help files