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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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