selenium webdriver error, gecko driver downloaded - firefox

receiving the below error,i made sure i added the library for the webdriver
also started the standalone server from command prompt
I am new to software testing, any help would be greatly appreciated
Firefox version 53

Make sure the absolute path you have provided for gecko driver is correct.
If we are going to launch the browser for the first time we should use get method instead of navigate as below.
driver.get("http://www.calculator.net");
Once you have launched the browser with url,using get method(as above eg..) you can use navigate.to to navigate to other url's
No need to start the selenium server from the command prompt. Just refer the selenium standalone jar to the build path of the java project.

Related

Apache-JMeter 5.4

I set an open JDK version in my pc to run JMeter. I was confirmed that jdk installation is fine by "java -version" command. Till now, all going well. But when I tried to run Jmeter.bat file a cmd interface appears that is irreversible.
Here is the screenshot. (https://prnt.sc/x8endi)
Is JMeter 5.4 is compatible with Open JDK version(11.0.2)?
Have you tried to click "Alt-Tab" to switch to JMeter GUI?
I think you're suffering from a side-effect of fixing bugs 62179 and 64658 so now JMeter doesn't bring itself into focus. If you don't think this behaviour is acceptable you can raise an issue
Alternatively you can downgrade to JMeter 5.3, previous versions of JMeter can be obtained from JMeter Archives page

Linux - How to add driver to selenium standalone?

I have an Ubuntu server and up there I have a JAR file Selenium standalone.
Whenever I want to test website via Firefox, I have to run the Selenium with an added param Dwebdriver.firefox.bin, otherwise, I will get an error saying that WebDriver cannot find the binary path for Firefox (though it is installed under /usr/bin/firefox)
My question is, is there a way not to use that param?

Why GWT browser plugin is not supported in Mozilla Firefox 27 onwards?

I am not able to run my GWT application due to browser plugin issue. I have tried to find the GWT plugin for Mozilla Firefox browser for the version of 36. Could you please anyone can help me to identify the suitable plugin.
Rationale can be found in the GWT forum: https://groups.google.com/d/msg/google-web-toolkit/QSEjbhhHB4g/wtI5TYFRevsJ
TL;DR: the plugin was using APIs that have been removed in Firefox 27, so it's no longer possible to compile it (and it was required to recompile it for each new version of Firefox).
Now, I am successfully running my gwt application on any of the browser, without installing any browser plugin. If you are using gwt-2.6.0, run your application in Super Server Mode. That will generate a link related to your application. Place that link in any browser url bar and run it. But it will take some time of compiling the application and then you will get the UI on the browser screen. To install gwt-2.6.0 onwards, your installed JDK should be after 7 version.

Selenium store result of web service/AJAX call

Is it possible to store the result of a web service/AJAX call into the store element, so that its value can be used in multiple locations.
The reason for this is we would like to have an automated test suite that uses data defined in a database. This would make it much easier to change bulk data in the tests (instead of searching through all of our test cases to change the data).
I understand that we can create a test case at the beginning of our test suite that defines all of this data however, we would like to easily switch between data sets without having to re-type each value.
I'm not sure how you can do what you're asking. It would be cool to learn. But let me give you a different approach which is very easy. I can answer any questions you may have. Create 3 different commands in your Selenium IDE to start things off, where your target for the open command is the path of the page you're automating.
Command: open
Target: --path--
Value:
Command: storeExpression
Target: 123
Value: var_number
Command: type
Target: TextBox1
Value: ${var_number}
Then use the export option in Selenium IDE as Java code (or another language). You won't have the Options > Format > options unless you turn on "Enable Experimental Features" in options. Choose "JUnit 4 (Remote Control or RC)"--Selenium 1. I'm not familiar with "JUnit 4 (WebDriver)"--Selenium 2 yet, but it's a bit newer, and not as much documentation. Then download Eclipse Classic, the Java JDK, the Selenium client driver for Java (on the Selenium site)--dll #1, and download JUnit 4--dll #2. Import both of those dll files into the Library tab (in Eclipse classic) after creating a new project in the project wizard, and open your export code that was exported using the Selenium IDE format export. Eclipse should be configured to automatically compile your code by default. Then just create an loop in the Java code and repeat the commands above. Then connect to your database from Java (with some simple SQL connection code), and read your data from the result set inside of your loop. Then right click in the Eclipse file explorer and choose JUnit on your unit test to launch a Mozilla Firefox instance to have it automate your loop. Or you can launch any other browser to run your JUnit test.. just change "*chrome" (aka Mozilla not Google Chrome) to "*iexplore" (Internet Explorer) or "*googlechrome" (Google Chrome), etc... for a browser of your choice in the Java code.
Pardon my jargon on "dll files". I meant to write assemblies or libraries. In Java, the correct term would be a *.jar. I'm use to writing in .NET code. If you choose to run your unit tests in .NET, then you will need to repeat most of what I have above, but instead download NUnit and use Visual Studio rather than Eclipse. The documentation is much better for JUnit, so that's why I went that route. That statement might not be correct. That's just what I found to be true from observation when I did a proof of concept for my company.
Oh, and because you're using client drivers, you need to have the Java (JUnit Test) program connect to your Selenium Remote Control Server. So you must download the Selenium server also. Then call the Jar from the command line in Windows. It must be running before running your JUnit test. This server won't run unless the JDK is installed on your machine!
java -jar selenium-server-standalone-2.0rc3.jar
The contributed user extension: http://wiki.openqa.org/display/SEL/global makes use of the global array globalStoredVars which you should be able to use.
I started recently to test a multilanguage website using Selenium with javascript, see Testing-a multilanguage website with selenium

Problem about running php test suite and test case using Selenium RC

I need a php test case and how can i test a php test case using selenium RC. Already i have set up Selenium RC in my computer.Not only that, i need a test suite. What is the purpose of test suite and test case? Is the test suite and test case same thing?
It would be very helpful helpful for me if any one post a solution in the blog as early as possible.
The Recorded test scripts can be than exported to PHP language and with the help of these you can create a library which contains all the functions/tests which has to be performed on the application
Now create the suites for different libraries which will call the functions in the libraries and executes it on application.
Start the Selenium RC using the command “java –jar selenium-server. jar”
On the new command prompt enter the specific directory location of the file and enter “phpunit xyz.php”
Selenium is a tools that let you automate visits to a site and test for conditions; mostly presense of text on page or in html controls. The selenium server needs to be running which will enable you to control a browser (firefox by default) to do you automation tasks.
Starting the server could be something like
"javaw.exe" -jar selenium-server-standalone-2.0b2.jar"
where javaw.exe is part of your java runtime, most likely in C:\Program Files (x86)\Java\jre6\bin\ or C:\Program Files\Java\jre6\bin\.
You also have the possibility of installing a Selenium IDE as a plugin to firefox which lets you record, edit and playback tests.
The most likely usage would though be to implement tests in a test runner like nunit or a php program. The IDE has export functionality for this.

Resources