Can we Retrieve text from a Search Bar Field

30 views
Skip to first unread message

satish ranjan

unread,
Sep 4, 2017, 8:23:53 PM9/4/17
to webdriver
Can we retrieve text from a Search Bar Field ?

darrell grainger

unread,
Sep 6, 2017, 8:15:58 AM9/6/17
to webdriver
The concept of a "Search Bar Field" isn't really a standard terminology that I am used to. If the field is in the DOM and viewable in the Inspect window (on Chrome, right click and select Inspect; on Firefox, right click and select Inspect Element) then you should be able to retrieve the information using WebDriver.

However, if the field is part of the browser application then it might not be accessible using WebDriver. WebDriver is implemented using javascript. Part of the javascript standard is that it cannot access anything on your personal computer. This includes things like the desktop application chrome.eve or firefox.exe. This is by design. If I could use javascript to access things outside the DOM then a malicious person could write a javascript program on their website which could influence or infect your computer. In order to safeguard you against malicious javascript programs, WebDriver does have limitation.

If you can give an example of the "Search Bar Field" we might be able to help you (a) determine if it can be accessed with WebDriver and (b) how you would go about accessing it.

Darrell
Reply all
Reply to author
Forward
0 new messages