I want to locate a dropdown list in robot framework using selenium library. But, I'm facing a locator error like this.
Below is my script and error.
*** Settings ***
Library SeleniumLibrary
*** Variables ***
*** Test Cases ***
Positive Test Case
open browser https://demotestapp-dev.azurewebsites.net/ chrome
input text xpath://body[1]/div[1]/main[1]/article[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[2]/input[1] Matt
input text xpath://body[1]/div[1]/main[1]/article[1]/div[1]/div[1]/div[1]/form[1]/div[2]/div[2]/input[1] Thomas
click element xpath=//body[1]/div[1]/main[1]/article[1]/div[1]/div[1]/div[1]/form[1]/div[3]/div[2]/div[1]/label[1]
sleep 2
select from list by label Gender Male
select checkbox CheckBox1
click element xpath://body[1]/div[1]/main[1]/article[1]/div[1]/div[1]/div[1]/form[1]/button[1]
close browser
click link xpath://body/div[1]/div[1]/div[2]/nav[1]/div[1]/a[2]
*** Keywords ***
Positive Test Case
| FAIL |
List with locator 'Gender' not found.
-------------------------------------------------------------------
-----------
TC 01
| FAIL |
1 test, 0 passed, 1 failed
Here, the "Gender" is the Radzen component name.
<div class="row mb-5">
<div class="col-md-4">
<RadzenLabel Text="Gender" />
</div>
<div class="col d-flex flex-row">
<RadzenDropDown @bind-Value="student.Gender" Data="@genders" style="width: 100%;" TextProperty="Name" ValueProperty="Id" Name="Gender" >
</RadzenDropDown>
<RadzenRequiredValidator Component="Gender" Text="Gender is required" Popup=true Style="position: absolute" />
</div>
</div>
I tried using div classes.But I got the same not found error.Can anyone give a solution for this?