How to find elements within a form with selenium vba

nando88

Board Regular
Joined
Jun 22, 2013
Messages
124
I need to find a nested element within a form, but I always get an error saying element not found.
1692751002080.png

This is part of the html code and the element I need to find is <input id="_paramsP1_FROM_DATE".
Please help me by providing some code that I can use to find this element in the html code.

Thanks in advance.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Presumably you've tried:
VBA Code:
    Dim elem As WebElement
    Set elem = driver.FindElementById("_paramsP1_FROM_DATE")
Are there any frames/iframes involved? If so, you'll need to switch to the correct frame first:
VBA Code:
    driver.SwitchToFrame driver.FindElementsByTag("iframe")(1)  '1st iframe
 
Upvote 0
Thanks for the reply, but that doesn't work since it is inside a form control and not an iframe.
Maybe you know a way for me to find an input control by id, since I already tried looking for the input control, but I wasn't able to find it.
Thanks in advance.
 
Upvote 0
I placed a picture of the html code in the original message, please refer to that picture in order to give your answer.
Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top