How to Run Selenium code in webtest? - webtest

I am new to webtest and I read that it is possible to record script in selenium and then run it via webtest/fitnesse. I have got webtest and selenium installed and configured. Is there specific format of code that suites webtest? Any help regarding this will be appreciated

The doc is now more complete: http://webtest.pythonpaste.org/en/latest/modules/sel.html
You need to run java -jar selenium-server.jar
Then write your test like with the TestApp but using SeleniumApp

Related

BlazeMeter/JMeter Issue: JUnit Sampler ClassNotFoundException

I'm new to BlazeMeter and JMeter.
I created a simple Selenium JUnit Script, it can run in IDE.
I then loaded the script into JMeter using JUnitSampler. I run the test in JMeter on my local and it was able to run. Then I uploaded the .jmx file to BlazeMeter and when I try to run it, it would fail.
If I look into the Logs page on BlazeMeter, it complains ClassNotFoundException. Can anybody tell me what's wrong?
2017-11-23 20:16:47,497 WARN o.a.j.p.j.s.JUnitSampler: ClassNotFoundException:: xxxxxx.SampleLoadTest2
And on BlazeMeter Failed Report Summary page, it shows
Error Running Test
The test encountered the following fatal error, and could not complete successfully:
Error: r-v3-5a172c6260523 - Session ended without load report data
you most probably didn’t add the required libraries on Blazemeter (selenium jars...)
So ensure you add them and it should work

running selenium test suites created by selenium ide (firefox) over command line (ubuntu)

I have the problem that my selenium tests created via the firefox plugin "Selenium IDE" won't work when executed over cli with htmlsuite command. The test should simply open google.de in firefox browser.
I can record and execute the test just fine in selenium ide, but when i execute the following command in cli:
java -jar /var/lib/jenkins/jobs/SuiteCRM_CI_Test/selenium-server-standalone-2.48.2.jar -debug -log /home/jenkins/wtflog.log -firoxProfileTemplate /var/lib/jenkins/jobs/SuiteCRM_CI_Test/firefox_profile -htmlSuite *firefox http://google.de /home/koschig/Arbeitsfläche/seleniumtests/googlesuite.html results.html
All that happens is, firefox will be opened with 2 tabs: one being the firstrun" tab and the other is the following:
chrome://src/content/TestRunner.html?auto=true&multiWindow=true&defaultLogLevel=info&baseUrl=http%3A%2F%2Fgoogle.de&resultsUrl=http://localhost:4444/selenium-server/postResults&test=http%3A%2F%2Flocalhost%3A4444%2Fselenium-server%2Ftests%2Fgooglesuite.html
which gets me an error, file not found
Well, I don't know where the first half of this url comes from, the second half is crafted with the parameters I wrote in the command line.
Does anyone know how to solve this problem? I expected that firefox will be opened and google.de will be accessed...

Running Selenium IDE from batch file ignores user-extensions.js and selblocks. Why?

Hi I would really like to run a testsuite via the Selenium IDE, which I have started up with some custom commands in user-extensions.js and the SelBLocks extensions (for flow control)
with no success.
Is there a command that will start firefox and run the selenium plugin with the suite and baseurl as an argument?
I have had better luck with running the suite with the following command in a batch file (with suitable values for the baseurl, suite & logfile:
java -jar selenium-server-standalone-2.32.0.jar -htmlSuite "*firefox" "%baseurl%" "%suite%" "%log%" -port 4445
But the testrunner will die as soon as it encounters a command defined in user-extensions.js and/or a command from Selblocks.
Can anyone offer some clues to solving either of the above?
The IDE solution would be better (for me) as we do not have a great deal of java or webdriver talent here.
ANNOUNCEMENT: SelBlocks 2.1 now includes support for Selenium Server. Get the extension file here: https://raw.githubusercontent.com/refactoror/SelBlocks/master/user-extensions.js
Initial browser support is for firefox, googlechrome, and opera.
Answering part of my own question here...
add the userExtension parameter to the java command to load the user extensions.
java -jar selenium-server-standalone-2.32.0.jar -userExtensions "path\to\user-extensions.js" -htmlSuite "*firefox" "%baseurl%" "%suite%" "%log%"
Still not sure how to get it to understand the selblocks commands though.

Run selenium scripts in Internet Explorer

I am currently using Selenium RC to run my scripts in FF in windows. Could you tell me how to run the scripts in IE as well?
Your question is not very clear, but assuming you mean you are using the Selenium IDE Firefox plugin to create your tests, you will find this blog post helpful.
You need java installed.
If you're on Windows you probably need to run the command as administrator.
Then run the following command as administrator
java -jar selenium-server-standalone-2.0b3.jar -htmlSuite "*iexplore"
"http://www.google.com" "TestSuite.html"
"results.html" -port 4445
where the parameter "*iexplore" specifies to use InternetExplorer.
Instead of using *firefox or *chrome in your script , use *iexplore or *iexploreproxy

CentOS Selenium - Preparing firefox profile

I'm trying use to selenium with firefox on CentOS from command line like this:
java -jar selenium-server-standalone-2.19.0.jar -interactive
Then, I type:
cmd=getNewBrowserSession&1=*firefox&2=http://www.google.com
Then it stucks on "Preparing Firefox profile..." part and crashes:
13:59:13.105 INFO - Preparing Firefox profile... 13:59:33.366 ERROR -
Failed to start new browser session, shutdown browser and clear all
session data
Please help me solve this, I'm quite new to the unix world.
Thanks!
Are you pointing directly to the firefox executable, or are you pointing to an alias?
By default selenium should be pointing to your selenium binary, what is in /usr/bin is usually a script that interacts with the firefox executable.
you could define a specific firefox profile (you have to create it first):
java -jar selenium-server.jar -log SeleniumServer.log -firefoxProfileTemplate "PROFILEPATH" -interactive
And for those wondering, if you're at the command line, you can create a profile like this:
firefox -CreateProfile profilename

Resources