leochabi / selenium-vba

Automatically exported from code.google.com/p/selenium-vba
0 stars 1 forks source link

findElementById is throwing an error in version 1.0.16.0 #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Operating system : Win 7 - 64 Bit
.Net Framework version :
Office Version : 2010
SeleniumWrapper version : 1.0.16.0

What is your issue ?
I had the following code, which was working fine in version 1.0.14.0. I am 
using this to capture all options in a dropdown in objCollection:-
objCollection = 
driver.findElementById("test_id").findElementsByTagName("option")

But the line throws an error after I upgrade to version 1.0.16.0
Error - Run-time Error '5': Invalid procedure call or argument

Pls let me know whether I need to modify my code or is this a bug?

Original issue reported on code.google.com by rohan.ka...@gmail.com on 11 Dec 2013 at 7:58

GoogleCodeExporter commented 8 years ago
There was a fix related to an element collection.
The collection now requires the Set in front of the variable.
In your case :
Set objCollection = 
driver.findElementById("test_id").findElementsByTagName("option")

The same one optimized :
Set objCollection = driver.findElementsByCssSelector("#test_id option")

Original comment by florentbr on 12 Dec 2013 at 2:30

GoogleCodeExporter commented 8 years ago
Thnx a lot for your prompt reply

Original comment by rohan.ka...@gmail.com on 12 Dec 2013 at 3:17

GoogleCodeExporter commented 8 years ago

Original comment by florentbr on 8 Sep 2014 at 5:40