Hey there,
Here is my situation with the error "'Browser' is not declared. It may be inaccessible due to its protection level" I am getting:
- Website has a login that has an option to 'remember this computer'
- When that aforementioned option is not selected, anytime you login with this userId, you will be met with a page that requests you to answer a security question to proceed
- As this script could be run on a variety of desktops, some might clear caches, some might not, so we need a way:
- To check if the 'Confirm your Identity' page has displayed
- If so, negotiate the security answer
- If not, then proceed with the rest of the script as if it never popped up
I dug around the internet and saw nothing about best practices using this method. Script is very simple (line in bold italics is the problemline):
Imports System.Diagnostics
Imports SilkTest.Ntf.XBrowser
Imports System.IO
Public Module Main
Public _desktop As Desktop = Agent.Desktop,
applicationProcess As New Process(),
ieprocess As New Process(),
chromeprocess As New Process(),
psi As New ProcessStartInfo()
Public Sub Main
With _desktop.BrowserApplication()
.SetActive()
.Maximize()
With .BrowserWindow("@url='*website.com*'")
Call Exists()
End Sub
Public Sub Exists()
With _desktop.BrowserApplication()
With .BrowserWindow("@url='*website.com*'")
<steps here>
BrowserWindow.WaitForObject("//BrowserWindow[@url='https://website.com/clientportal/j_security_check']", 10000)
.DomTextField("//input[@name='securityAnswer1']").SetText("securityanswer")
.DomButton("//input[@id='continue']").DomClick
End Sub
So what do you think woul dbe the best way to handle this?