-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Method. IsElementPresent, IsEnabled, IsDisplayed #27
Comments
Shouldn't the ImplicitlyWait methods in IsElementPresent function take sessionid as an input? And I suggest the following more efficient way to disable-enable Implicitly wait:
|
If you add the raise parameter to Execute function, as I demonstrated use for in Navigate function here, then IsElementPresent can be simplified as below:
Here is what raise-enabled Execute looks like (edited to fix Execute bug #46 ):
|
Thank You. |
Suggest to change method name IsElementPresent to IsPresent to be consistent with IsEnabled and IsDisplayed.. |
Change method name IsElementPresent to IsPresent. ' Is Present '2022/1/10 chg ishi
Public Function IsPresent(by_ As By, _
ByVal value As String, _
Optional ByVal sessionId As String = vbNullString) As Boolean
Dim timeout As Double
Dim Resp As Dictionary
Dim Data As Dictionary
timeout = GetImplicitlyWait(sessionId)
If timeout <> 0 Then SetImplicitlyWait 0, sessionId ' ImplicitlyWait Disable
Set Data = ToSelector(by_, value)
If sessionId = vbNullString Then
Data.Add "sessionId", DefaultSessionId
Else
Data.Add "sessionId", sessionId
End If
Set Resp = Execute(CMD_FIND_ELEMENT, Data, False)("value") ' don't raise an error if not present
If Not Resp.Exists("error") Then
IsPresent = True
Else
IsPresent = False
End If
If timeout <> 0 Then SetImplicitlyWait timeout, sessionId
End Function |
TinySeleniumVBA WebDriver.cls
TinySeleniumVBA WebElement.cls
The text was updated successfully, but these errors were encountered: