Cableguy Expert Licensed User Longtime User Jan 11, 2025 #1 Hi guys, I guess this one is for our HTML expert users... I have this input field in a form: <input type="text" name="name" placeholder="Email address / account name"> I can interact with it by using B4X: Copy Dim LoginForm As Object = Selenium.FindByClassName("","formV2") 'this is my form Dim Login As Object = Selenium.FindByClassName(LoginForm, "input") 'this works, but why??? Selenium.WebElementSendKeys(Login, "pendrush") I need to next interact with <input type="password" name="password" placeholder="Password"> which is part of the same form... but I just can't "find" it!! Any hints??
Hi guys, I guess this one is for our HTML expert users... I have this input field in a form: <input type="text" name="name" placeholder="Email address / account name"> I can interact with it by using B4X: Copy Dim LoginForm As Object = Selenium.FindByClassName("","formV2") 'this is my form Dim Login As Object = Selenium.FindByClassName(LoginForm, "input") 'this works, but why??? Selenium.WebElementSendKeys(Login, "pendrush") I need to next interact with <input type="password" name="password" placeholder="Password"> which is part of the same form... but I just can't "find" it!! Any hints??
Solution Pendrush Jan 11, 2025 First update library and check examples: B4X: Copy Dim LoginForm As Object is B4X: Copy Dim LoginForm As Pnd_WebElement Explanation of your code: "LoginForm As Object" is FORM tag and everything inside <form> </form> "Dim Login As Object" is INPUT field inside <form> </form> tag. Login is a child WebElement of his parrent WebElement LoginForm. It is much more easier to update library and use new classes and properties. Not tested code, with updated library: B4X: Copy Dim LoginForm As Pnd_WebElement = Selenium.FindByClassName("formV2") Dim Login As Pnd_WebElement = LoginForm.FindByName("name") ' searching for name="name" inside LoginForm WebElement Dim Pass As Pnd_WebElement = LoginForm.FindByName("password") ' searching for...
First update library and check examples: B4X: Copy Dim LoginForm As Object is B4X: Copy Dim LoginForm As Pnd_WebElement Explanation of your code: "LoginForm As Object" is FORM tag and everything inside <form> </form> "Dim Login As Object" is INPUT field inside <form> </form> tag. Login is a child WebElement of his parrent WebElement LoginForm. It is much more easier to update library and use new classes and properties. Not tested code, with updated library: B4X: Copy Dim LoginForm As Pnd_WebElement = Selenium.FindByClassName("formV2") Dim Login As Pnd_WebElement = LoginForm.FindByName("name") ' searching for name="name" inside LoginForm WebElement Dim Pass As Pnd_WebElement = LoginForm.FindByName("password") ' searching for...
Pendrush Well-Known Member Licensed User Longtime User Jan 11, 2025 #2 First update library and check examples: B4X: Copy Dim LoginForm As Object is B4X: Copy Dim LoginForm As Pnd_WebElement Explanation of your code: "LoginForm As Object" is FORM tag and everything inside <form> </form> "Dim Login As Object" is INPUT field inside <form> </form> tag. Login is a child WebElement of his parrent WebElement LoginForm. It is much more easier to update library and use new classes and properties. Not tested code, with updated library: B4X: Copy Dim LoginForm As Pnd_WebElement = Selenium.FindByClassName("formV2") Dim Login As Pnd_WebElement = LoginForm.FindByName("name") ' searching for name="name" inside LoginForm WebElement Dim Pass As Pnd_WebElement = LoginForm.FindByName("password") ' searching for name="password" inside LoginForm WebElement Login.SendKeys("MyUsername") Pass.SendKeys("MyPassword") Last edited: Jan 11, 2025 Upvote 0 Solution
First update library and check examples: B4X: Copy Dim LoginForm As Object is B4X: Copy Dim LoginForm As Pnd_WebElement Explanation of your code: "LoginForm As Object" is FORM tag and everything inside <form> </form> "Dim Login As Object" is INPUT field inside <form> </form> tag. Login is a child WebElement of his parrent WebElement LoginForm. It is much more easier to update library and use new classes and properties. Not tested code, with updated library: B4X: Copy Dim LoginForm As Pnd_WebElement = Selenium.FindByClassName("formV2") Dim Login As Pnd_WebElement = LoginForm.FindByName("name") ' searching for name="name" inside LoginForm WebElement Dim Pass As Pnd_WebElement = LoginForm.FindByName("password") ' searching for name="password" inside LoginForm WebElement Login.SendKeys("MyUsername") Pass.SendKeys("MyPassword")
Cableguy Expert Licensed User Longtime User Jan 11, 2025 #3 Hi @Pendrush I have updated the lib... I really thought I had the latest, since I downloaded it late december... Still, I have no such definition is current v0.98 for pnd_WebElement I will try to continue my testing... Upvote 0
Hi @Pendrush I have updated the lib... I really thought I had the latest, since I downloaded it late december... Still, I have no such definition is current v0.98 for pnd_WebElement I will try to continue my testing...
Pendrush Well-Known Member Licensed User Longtime User Jan 11, 2025 #4 You are missing few classes for some reason: Upvote 0
Cableguy Expert Licensed User Longtime User Jan 11, 2025 #5 indeed... has the drivers also changed?? Upvote 0
Pendrush Well-Known Member Licensed User Longtime User Jan 11, 2025 #6 I just re-downloaded library and i can see all classes. Try to download again. Close B4J, and then extract ZIP to additional lib folder and then run B4J. Its look like you have old Pnd_Selenium.xml file. Upvote 0
I just re-downloaded library and i can see all classes. Try to download again. Close B4J, and then extract ZIP to additional lib folder and then run B4J. Its look like you have old Pnd_Selenium.xml file.
Pendrush Well-Known Member Licensed User Longtime User Jan 11, 2025 #7 Cableguy said: indeed... has the drivers also changed?? Click to expand... Explanation is on the bottom of the page: Selenium Library - Pnd_Selenium Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should) also be automated as well. Library... www.b4x.com Upvote 0
Cableguy said: indeed... has the drivers also changed?? Click to expand... Explanation is on the bottom of the page: Selenium Library - Pnd_Selenium Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should) also be automated as well. Library... www.b4x.com
Cableguy Expert Licensed User Longtime User Jan 11, 2025 #10 ok, thank you... I just also downloaded the exemples bundle... Upvote 0
Pendrush Well-Known Member Licensed User Longtime User Jan 11, 2025 #11 There is 18 examples, explaining different things. Upvote 0
Cableguy Expert Licensed User Longtime User Jan 11, 2025 #14 And it already seem easier to use!!! a big thank you.... Upvote 0
Pendrush Well-Known Member Licensed User Longtime User Jan 11, 2025 #15 B4J library is now "almost" incidental to original, a lot of changes in last month, but is really easier to use it now. Upvote 0
B4J library is now "almost" incidental to original, a lot of changes in last month, but is really easier to use it now.