Unable to install Firebug and FirePath despite looking for suggestions - selenium

I believe the default Selenium web browser is Firefox. My professor asked me to operate Selenium with Firefox version 43.0.1. Above it doesn't work, tested! However the issue is, I installed the latest version of Firebug and FirePath to get the XPaths. But it doesn't seem to work. Please help. I have read the earlier posts on a related topic in StackOverflow, still not working.

Firebug is officially discontinued. Though you don't need Firebug or FirePath to use Selenium.
Selenium also works with CSS selectors. Or, if you really need XPaths, you can copy them using the Firefox DevTools' Inspector.

Related

I am trying to use webdriver in the selenium module but I keep getting an error no matter what I'm doing

As stated, I am trying to use webdriver.Chrome in this sample project I'm doing but I am completely lost on what to do. This is the error I get error. But when I look at the version of chrome I installed, it seemed to match up. Chrome Version. Does anyone know what's happening? Sorry if the post is too unspecific.
You have to update your chrome browser. Try to update the installed chrome version to latest version.
To overcome this problem, use WebDriverManager: refer - https://bonigarcia.dev/webdrivermanager/ and https://github.com/bonigarcia/webdrivermanager.
If you are using Python with selenium, refer to this post for sample code:
Chrome with WebDriver--Why is it disappearing as soon as I hit "run"? Chrome Driver version 106 but Chrome can only be 105.0.9
If you are using Java with selenium, refer to this post for sample code:
element click intercepted in Selenium wedriver

how to detect selenium/webdriver browsing on my site

Does anyone know how to detect selenium/webdriver browsing on my site?
I don't want to block them, just detect them.
I saw this question:
Can a website detect when you are using selenium with chromedriver?
But trying all of these on latest version didn't seem to work.
Any body knows anything else?
P.S. please don't leave answers/comments of "dont block"/"you are looking in the wrong place" - I am fully aware of what I'm asking and what will be the business logic to use it.
-- EDIT --
Things I have tested from the link above:
detecting cdc_asdjflasutopfhvcZLmcfl_ key on elements, mostly on window and document but some other elements we have across the entire site.
Searching for window.navigator.webdriver always returns undefined instead of true (tested on both chrome and firefox although only firefox said to support it)
tested the script from this answer: https://stackoverflow.com/a/45814390/1593987
All tests were done using latest selenium, browsers (firefox and chrome), and latest webdriver plugins. for now only on windows, but will probably test ubuntu as well.
In recent versions of Selenium WebDriver it's handled on a spec level.
There is a read-only JS property - navigator.webdriver which is true in case webdriver is used to control browser.
Checked with Chrome v73 - returns true.
References:
Spec - https://w3c.github.io/webdriver/#dom-navigatorautomationinformation-webdriver
Firefox - https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver
Chrome - https://www.chromestatus.com/feature/6216034532982784

How to replace Chrome with PhantomJS for use with Selenium and Conductor?

I am successfully using the Conductor framework to scrape data off a website. I use the Chrome browser and therefore I have installed chromedriver.exe in the root of my project.
To speed things up I want to replace Chrome with the headless PhantomJS browser. I installed PhantomJS as explained in the answer to this Stackoverflow question: PhantomJS & Conductor Framework and have changed the browser to Browser.PHANTOMJS in #Config.
Whatever I do however, I get no results.
I found no documentation how to setup PhantomJS for use with Selenium or PhantomJS.
The question How to Implement Selenium WebDriver with PhantomJS and Can we Use Sikuli with PhantomJS? did not help either.
How to replace Chrome with PhantomJS for use with Selenium and Conductor?
The trouble you are having appears to be due to an older version of the PhantomJS library included in Conductor. The error when running PhantomJS can be found in this imported issue on the Selenium Github. The remedy is to import a fork of PhantomJS which works with the newer releases of Selenium.
You can easily implement this by editing the pom.xml file and swapping
<groupId>com.github.detro</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>${phantomjs_version}</version>
with
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.2.1</version>
You can use a headless chrome driver with selenium, as showed here:
https://duo.com/decipher/driving-headless-chrome-with-python

Selenium webdriver: what is the latest version of chrome driver?

I tried navigating to the Chrome driver website and saw that the latest release being documented was 2.22, but when I got to the index page, I saw that 2.9 was mentioned down the hierarchy.
Can somebody please help in understanding the above?
Please find chrome driver here
https://sites.google.com/a/chromium.org/chromedriver/downloads
The versions on the chromedriver download page are sorted alphabetically, not numerically or chronologically. That means that 2.9 appears at the bottom of the page, which might make it look like the "last" or "most recent" version. The actual most recent version as of this writing is, in fact, 2.22.
Use this Selenium site you have drivers for all browsers even for phone's.. Check it
http://www.seleniumhq.org/download/ - You may find there chrome webdriver 2.22Version

Is there a native XPath support in Internet Explorer 11?

I have a problem with my Selenium tests when using IEDriverServer.exe (32-bit). The same tests work fine in Firefox and Chrome browsers, but fail in Internet Explorer 11 with diagnostics:
OpenQA.Selenium.InvalidSelectorException : The xpath expression
'//input[#id='username']' cannot be evaluated or does notresult in a
WebElement
It seems that IEDriver cannot find elements by XPath.
IEDriver version: 2.48.
Is there any workaround for this problem, except changing XPath with CSS locators?
I found a possible reason in comments for a similar problem:
here
Update for IE11 KB3025390 (and latest ones) breaks IEDriver. When uninstall updates IEDriver successfully interacts with WebElements through XPath.