Selenium RC doesn't run the test suite by BAT file - java

I've tried to run my test suite by Selenium RC through a BAT file.
Actually it worked OK until yesterday morning and it stopped to run my test suite.
Probably because I've added user-extensions.js and since that I can't run my test suite by the selenium RC.
How can I add this script to my test suite?
I'm using Selenium IDE for to write my test cases, so I guess that make this more complex problem..
This is the console log of the BAT file during the execution:
>
C:\automation>cd C:\automation\screenshots\
C:\automation\screenshots>del *.png
Could Not Find C:\automation\screenshots\*.png
10:46:38.926 INFO - Launching a standalone server
10:46:39.098 INFO - Java: Oracle Corporation 25.25-b02
10:46:39.098 INFO - OS: Windows 8.1 6.3 amd64
10:46:39.113 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
10:46:39.238 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:4444/wd/hub
10:46:39.238 INFO - Version Jetty/5.1.x
10:46:39.238 INFO - Started HttpContext[/selenium-server,/selenium-server]
10:46:39.379 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#6e3c1e
69
10:46:39.379 INFO - Started HttpContext[/wd,/wd]
10:46:39.379 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
10:46:39.379 INFO - Started HttpContext[/,/]
10:46:39.379 INFO - Started SocketListener on 0.0.0.0:4444
10:46:39.379 INFO - Started org.openqa.jetty.jetty.Server#b1bc7ed
jar:file:/C:/automation/selenium-server-standalone-2.44.0.jar!/customProfileDirC
USTFFCHROME
10:46:39.535 INFO - Preparing Firefox profile...
10:46:42.666 INFO - Launching Firefox...
10:46:44.245 INFO - Checking Resource aliases
This is the code line from the BAT file:
java -jar C:\automation\selenium-server-standalone-2.44.0.jar -htmlSuite "*firefox C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "https://www.mywebsite.com" "C:\automation\emailSanity.html" "C:\automation\testing_results.html" -port 4444
This is the screenshot of the actual result of the Selenium RC in action:
http://i57.tinypic.com/28u71jl.png
Please your help!
Thanks a lot.

Considering your app is at the splash screen, I can only assume that you forgot to put in your URL to initially open.
Since you are using RC, then your first statement of your test script should be:
selenium.open("http://example.com"); // where example.com is the app is your SUT.

Related

Nifi commands on windows

In my current project, I have been using apache-nifi on Windows operating system.
I have extracted nifi-0.7.0-bin.zip file in C:\. Now, when I run \bin\run-nifi.bat as an administrator I see the following message on the command line and I am not able to run nifi. Could you please suggest what should I do in order to run the nifi.
the content of app.log file as follows
2016-08-08 11:41:57,716 INFO [main] org.apache.nifi.NiFi Launching NiFi...
2016-08-08 11:41:57,851 INFO [main] org.apache.nifi.BootstrapListener Started Bootstrap Listener, Listening for incoming requests on port 50050
2016-08-08 11:41:57,877 INFO [main] org.apache.nifi.BootstrapListener Successfully initiated communication with Bootstrap
2016-08-08 11:42:59,485 WARN [Timer-0] org.apache.nifi.NiFi NiFi has detected that this box is not responding within the expected timing interval, which may cause Processors to be scheduled erratically. Please see the NiFi documentation for more information.
The content of nifi-bootstrap.log file is as follows:
2016-08-08 11:41:57,279 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
2016-08-08 11:41:57,286 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
2016-08-08 11:41:57,286 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
2016-08-08 11:41:57,286 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
2016-08-08 11:41:57,298 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2016-08-08 11:41:57,299 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: C:\NIFI-0~1.0
2016-08-08 11:41:57,299 INFO [main] org.apache.nifi.bootstrap.Command Command: C:\Program Files\Java\jdk1.8.0_102\bin\java.exe -classpath C:\NIFI-0~1.0\.\conf;C:\NIFI-0~1.0\.\lib\jcl-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\jul-to-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\log4j-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\logback-classic-1.1.3.jar;C:\NIFI-0~1.0\.\lib\logback-core-1.1.3.jar;C:\NIFI-0~1.0\.\lib\nifi-api-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-documentation-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-nar-utils-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-properties-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-runtime-0.7.0.jar;C:\NIFI-0~1.0\.\lib\slf4j-api-1.7.12.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properties.file.path=C:\NIFI-0~1.0\.\conf\nifi.properties -Dnifi.bootstrap.listen.port=50049 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=C:\NIFI-0~1.0\bin\..\\logs org.apache.nifi.NiFi
2016-08-08 11:41:57,866 WARN [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Failed to set permissions so that only the owner can read status file C:\NIFI-0~1.0\bin\..\run\nifi.pid; this may allows others to have access to the key needed to communicate with NiFi. Permissions should be changed so that only the owner can read this file
2016-08-08 11:41:57,876 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 50050
I recommend running NiFi with the current directory context in the bin directory:
Open a new command prompt window
Change to the NiFi bin directory, cd c:\nifi-0.7\bin
From c:\nifi-0.7\bin, execute run-nifi.bat
I believe run-nifi.bat depends on finding nifi-env.bat in the current directory, rather than finding it relative to its own path. If you ran C:\...\nifi-0.7.0\bin\run-nifi.bat, I think you would see that error.

alpine linux docker image, console encoding trouble

I have a scala app that is running in docker container. I use image 'develar/java' which is based on alpine linux. My app is working, but i don't see cyrillic logs. Here what i have:
docker logs -f myApp
22:22:08.152 [main] INFO application - Creating Pool for datasource 'default'
22:22:09.213 [main] INFO play.api.db.DefaultDBApi - Database [default] connected at jdbc:postgresql://localhost/db
22:22:09.627 [main] INFO p.a.l.concurrent.ActorSystemProvider - Starting application default Akka system: application
22:22:09.698 [main] INFO application - ????????????? ??????? ???????
22:22:09.722 [main] INFO application - ????????????? ??????? 'direct
22:22:09.734 [main] INFO application - ????????????? ??????? 'adwords
22:22:09.761 [main] INFO play.api.Play$ - Application started (Prod)
22:22:09.866 [main] INFO play.core.server.NettyServer$ - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
But logs that are delivered to elasticsearch server are ok. How can i force alpine linux to work with utf-8?
develar/java has an old bug of an old glibc 2.21 package. Andy Shinn (the creator and maintainer of glibc package for Alpine) and I have resolved this a long time ago in glibc 2.23 packaging, which I have integrated into frolvlad/alpine-glibc, which is the base image for frolvlad/alpine-oraclejre8. Just replace devalar/java with frolvlad/alpine-oraclejre8:slim and you should be fine.

Selenium RC: I am unable run test suite in firefox or any other browser

I am newbie with Selenium. I recently encountered with one failure that I could not overcome.
I am trying to run next suite in firefox or chrome:
C:\auto_tools>java -jar selenium-server-standalone-2.46.0.jar -htmlSuite "*googlechrome C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://google.com" "D:\Selenium_2.0\Selenium_tests\Selenium_IDE&Selenium Builder\Selenium_start\test_suit.html" "D:\Selenium_2.0\Selenium_tests\Selenium_IDE&Selenium Builder\Selenium_start\results.html"
As answer I am see chrome browser with:
http://google.com/selenium-server/core/TestRunner.html?auto=true&multiWindow=true&defaultLogLevel=info&baseUrl=http%3A%2F%2Fgoogle.com&resultsUrl=../postResults&test=http%3A%2F%2Fgoogle.com%2Fselenium-server%2Ftests%2Ftest_suit.html
and
23:02:46.698 INFO - Launching a standalone Selenium Server
23:02:46.825 INFO - Java: Oracle Corporation 25.45-b02 23:02:46.826
INFO - OS: Windows 7 6.1 amd64 23:02:46.838 INFO - v2.46.0, with Core
v2.46.0. Built from revision 87c69e2 23:02:46.897 INFO - Driver class
not found:com.opera.core.systems.OperaDriver 23:02:46.897 INFO -
Driver provider com.opera.core.systems.OperaDriver is not registered
23:02:47.096 INFO - Launching Google Chrome...
with *firefox path/to/firefox.exe - same issue...
Can anyone help please?
Yesterday I found out that the reason was that my antivirus blocked connection to localhost including port 4444 - thats why I could not run test suit.

How to run selenium using other browsers?

I've configured the Selenium 2.0 IDE in Firefox and I execute my Project using this IDE.
Execute the Project using IDE.
And i Play back the executed screens.
Saved those Test case in HTML and Java format. (For Java: I used Jnit/Webdriver)
Then i open the java file using eclipse to change for Chrome Driver
After that i append this code into that System.setProperty();
Then i executed the Chromewebdriver using Command Prompt java -Dwebdriver.chrome.driver=/path/to/chromedriver -jar selenium-server-standalone-2.7.0.jar
Then i got the error as
C:\Program Files\Java\jdk1.6.0\bin>java -Dwebdriver.chrome.driver=c:/Users/FSP/D
ownloads/chromedriver.exe -jar selenium-server-standalone-2.39.0.jar
Unable to access jarfile selenium-server-standalone-2.39.0.jar
C:\Program Files\Java\jdk1.6.0\bin>java -Dwebdriver.chrome.driver=c:/Users/FSP/D
ownloads/chromedriver.exe -jar c:/Users/FSP/Downloads/selenium-server-standalone
-2.39.0.jar
Feb 22, 2014 6:48:37 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
18:48:39.395 INFO - Java: Sun Microsystems Inc. 1.6.0-b105
18:48:39.405 INFO - OS: Windows Vista 6.1 x86
18:48:39.618 INFO - v2.39.0, with Core v2.39.0. Built from revision ff23eac
18:48:40.440 INFO - Default driver org.openqa.selenium.iphone.IPhoneDriver regis
tration is skipped: registration capabilities Capabilities [{platform=MAC, brows
erName=iPhone, version=}] does not match with current platform: VISTA
18:48:40.500 INFO - Default driver org.openqa.selenium.iphone.IPhoneDriver regis
tration is skipped: registration capabilities Capabilities [{platform=MAC, brows
erName=iPad, version=}] does not match with current platform: VISTA
18:48:41.089 INFO - RemoteWebDriver instances should connect to:
18:48:41.091 INFO - Version Jetty/5.1.x
18:48:41.122 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
18:48:41.124 INFO - Started HttpContext[/selenium-server,/selenium-server]
18:48:41.125 INFO - Started HttpContext[/,/]
18:48:41.772 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#1db4f6
f
18:48:41.772 INFO - Started HttpContext[/wd,/wd]
18:48:41.799 WARN - Failed to start: SocketListener0#0.0.0.0:4444
Exception in thread "main" org.openqa.jetty.util.MultiException[java.net.SocketE
xception: Unrecognized Windows Sockets error: 0: JVM_Bind]
at org.openqa.jetty.http.HttpServer.doStart(HttpServer.java:696)
at org.openqa.jetty.util.Container.start(Container.java:72)
at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:4
88)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:30
0)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:24
5)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:96)
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.openqa.jetty.util.ThreadedServe`enter code here`r.newServerSocket(ThreadedServer.j
ava:392)
at org.openqa.jetty.util.ThreadedServer.open(ThreadedServer.java:478)
at org.openqa.jetty.util.ThreadedServer.start(ThreadedServer.java:504)
at org.openqa.jetty.http.SocketListener.start(SocketListener.java:202)
at org.openqa.jetty.http.HttpServer.doStart(HttpServer.java:726)
at org.openqa.jetty.util.Container.start(Container.java:72)
at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:4
88)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:30
0)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:24
5)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:96)
C:\Program Files\Java\jdk1.6.0\bin>
How to solve this? So please try to configure and run the script through other browsers using webdriver concept.
It might be classpath issue....
Download the latest version of selenium, say 2.39.0 from the seleniumHQ.org site.
Place it in C:\ drive. Goto the environment variables and add java -jar selenium-server-standalone-2.39.0.jar to the classpath

Selenium Server doesn't bind to socket after being killed with SIGTERM

After being killed once, selenium server hangs on all further startups without even trying to acquire the server port.
Rebooting fixes the problem. Running as a different user makes selenium start up again as well, but after that process gets killed it won't work no more.
This is on Linux 2.6.32-5-amd64 (debian squeeze) in a VirtualBox VM. Looking at a log of the system calls when it's working and when it's not, some component seems to lock up before the socket is even bound. The selenium log isn't of much help.
The output doesn't give any indication either:
$ java -jar selenium-server-standalone-2.28.0.jar
Dec 27, 2012 5:41:35 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
17:41:35.703 INFO - Java: Sun Microsystems Inc. 14.0-b16
17:41:35.704 INFO - OS: Linux 2.6.32-5-amd64 amd64
17:41:35.737 INFO - v2.28.0, with Core v2.28.0. Built from revision 18309
17:41:35.867 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
17:41:35.868 INFO - Version Jetty/5.1.x
17:41:35.868 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
17:41:35.869 INFO - Started HttpContext[/selenium-server,/selenium-server]
17:41:35.869 INFO - Started HttpContext[/,/]
This is a Java problem; its RNG needlessly reads from /dev/random. On a VM, the random pool is limited and often exhausted after one or two runs. For some reason, a part of the selenium/Jetty startup asks for the problematic RNG. To fix the problem, advise Java to use /dev/urandom instead:
java -Djava.security.egd=file:/dev/./urandom \
-jar selenium-server-standalone-2.28.0.jar
works fine.

Categories

Resources