I was using selenium rc and ruby a few months back.
Today when I tried using it, there are a lot of changes and there is no documentation.
Let me go through the differences between old and new.
Old
Download selenium remote control. It is a zip file. Unzip the file.
Now you will find the selenium server ( a jar file which u have to run from the command prompt) and the selenium client for ruby ( a driver file in the respective language, ie for ruby, u may expect selenium.rb)
Just copy selenium.rb to the project . In Netbeans IDE, u have to right click project, select properties, add to project ( jar or folder) and select the appropriate client driver.
New
In the ruby client folder, no selenium.rb exists. A doc folder is present which asks us to install the selenium gem.
Great, now it is a gem, but what am i supposed to do after that. I installed the gem.
When i run the ruby tests, a lot of errors come up. When i google for these errors, no help comes up.
Dot net to the rescue
I created a "test project" in visual studio 2008. Added the references, (by right clicking references and selecting browse -> selecting all the dlls inside the dot net client driver folder (inside remote control) ) and then copy pasted the code from selenium ide. Wonder of wonders! it works!!
From the code window, here is a sample test which verifies some basic test on the application ui.
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using Selenium;
namespace SeleniumTests
{
[TestFixture]
public class NewTest
{
private ISelenium selenium;
private StringBuilder verificationErrorsa;
[SetUp]
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://buytickets.thetrainline.com/");
selenium.Start();
verificationErrors = new StringBuilder();
}
[TearDown]
public void TeardownTest()
{
try
{
selenium.Stop();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
Assert.AreEqual("", verificationErrors.ToString());
}
[Test]
public void TheNewTest()
{
selenium.Open("/");
try
{
Assert.IsTrue(selenium.IsTextPresent("Buy train tickets"));
}
catch (AssertionException e)
{
verificationErrors.Append(e.Message);
}
selenium.Click("dnn_ctr24339_TissipGenericForm_LoginStatusAndRedirector.LoginStatus");
selenium.WaitForPageToLoad("30000");
try
{
Assert.IsTrue(selenium.IsTextPresent("Log in"));
}
catch (AssertionException e)
{
verificationErrors.Append(e.Message);
}
selenium.Click("//a[@id='dnn_ctr24339_TissipGenericForm_LoginStatusAndRedirector.Home']/span");
selenium.WaitForPageToLoad("30000");
try
{
Assert.IsTrue(selenium.IsTextPresent("Buy train tickets"));
}
catch (AssertionException e)
{
verificationErrors.Append(e.Message);
}
}//end of new test
}
}
Friday, January 23, 2009
Tuesday, January 20, 2009
Trying to run selenium with ruby
I had run with selenium.rb
Now they have converted it into a gem. Have to figure out how to use gem (if possible) with netbeans.
The selenium remote control download contains different folders for each language. Previously the ruby folder contained selenium.rb
Now the ruby folder contains only documentation. No ruby files. The documentations says to install selenium gem.
I wil give it a try and update this blog
Now they have converted it into a gem. Have to figure out how to use gem (if possible) with netbeans.
The selenium remote control download contains different folders for each language. Previously the ruby folder contained selenium.rb
Now the ruby folder contains only documentation. No ruby files. The documentations says to install selenium gem.
I wil give it a try and update this blog
Tuesday, November 18, 2008
Installed today in linux - ubuntu
Successfully installed the following.
1. Adobe acrobat reader - it should be a ".deb" package. Not an "rpm. I made that mistake here.
If you are using Open Suse, then rpm would be fine.
2. Installed Virtual box - Then installed Window XP in it. - > Windows XP is working fine.
3. Installed JDK - > and net beans on top of that.
1. Adobe acrobat reader - it should be a ".deb" package. Not an "rpm. I made that mistake here.
If you are using Open Suse, then rpm would be fine.
2. Installed Virtual box - Then installed Window XP in it. - > Windows XP is working fine.
3. Installed JDK - > and net beans on top of that.
Scribefire - easy blogging for everybody
I installed scribe fire. This is one tool I like best.
Easy to blog, with no hassles.
You can expect a lot more blogs in my site - with this tool! :)
Easy to blog, with no hassles.
You can expect a lot more blogs in my site - with this tool! :)
Saturday, November 15, 2008
I wanna run ALL windows programs on Linux!!
The solution seems to be "virtualization". Let me install vmware players and I will let you know the results.
Tristan Rhodes tells us about the five possible alternatives here-> http://useopensource.blogspot.com/2007/02/five-ways-to-use-windows-apps-in-linux.html
1. Use an open source alternative instead. And he gives the website (http://www.osalt.com/) which can provide open-source alternatives to any windows program u want.
2. Buy a commercial product that was designed for Linux
3. Use Wine to run the application in Linux -> The drawback is that all applications cannot be ported to linux.
4. Run Windows in a Virtual Machine -> Virtual box seems to be promising. I will let you know the results.
5. Run the application on a remote Windows system --> This is when you already have a windows server running for you. :)
Tristan Rhodes tells us about the five possible alternatives here-> http://useopensource.blogspot.com/2007/02/five-ways-to-use-windows-apps-in-linux.html
1. Use an open source alternative instead. And he gives the website (http://www.osalt.com/) which can provide open-source alternatives to any windows program u want.
2. Buy a commercial product that was designed for Linux
3. Use Wine to run the application in Linux -> The drawback is that all applications cannot be ported to linux.
4. Run Windows in a Virtual Machine -> Virtual box seems to be promising. I will let you know the results.
5. Run the application on a remote Windows system --> This is when you already have a windows server running for you. :)
Wednesday, October 29, 2008
Playing Quake 3 Arena in Linux
Tuesday, October 28, 2008
Wine : Running windows programs on Linux
http://www.go2linux.org/run-windows-software-on-linux-with-wine
I followed this great tutorial.
I could run putty.exe on Windows!!
The wine version I have used is : wine-1.1.7-2.1.i586.rpm
Other than this wine rpm, I have not installed anything!!
I followed this great tutorial.
I could run putty.exe on Windows!!
The wine version I have used is : wine-1.1.7-2.1.i586.rpm
Other than this wine rpm, I have not installed anything!!
Monday, October 27, 2008
Installing nvidia driver on Opensuse 10.2
openSUSE 10.2
It is very easy, most of the time.
WARNING: The NVIDIA driver RPMs for openSUSE 10.2 are built against the default kernel on the DVD and they should work after kernel updates provided trough YaST Online Update (YOU), but sometimes they don't, because the kernel update, forced by security reasons, broke compatibility with previous version. In this case you should follow instructions in the section The Hard Way to restore 3D.
1. Import the NVIDIA GnuPG key. Login in console as root user and type, or simply copy and paste using mouse:
rpm --import ftp://download.nvidia.com/opensuse/10.2/repodata/repomd.xml.key
2. Add the NVIDIA rpm-md repository: ftp://download.nvidia.com/opensuse/10.2/ to the package manager.
* To do this in YaST, go to Software -> Installation Source. Now hit Add and then select Specify URL. In there, enter the above URL and then hit Next, and then Finish.
* Or, to do this in Zypper execute:
zypper sa ftp://download.nvidia.com/opensuse/10.2/ nvidia
3. Identify which 'nvidia' driver packages you need. This depends on the exact model of your card. For a newer card you'll probably need x11-video-nvidiaG01 and nvidia-gfxG01-kmp-default packages. If your card is part of the NVIDIA Legacy then you'll need x11-video-nvidia and nvidia-gfx-kmp-default. (The list is taken from http://www.suse.de/~sndirsch/nvidia-installer-HOWTO.html)
If you are running on a non-default kernel flavour, you may need nvidia-gfxG0-kmp-bigsmp instead of nvidia-gfxG0-kmp-default (or nvidia-gfx-kmp-bigsmp instead of nvidia-gfx-kmp-default). "bigsmp" here is a your kernel flavor. You can find out your kernel flavor by running uname -r.
4. Install the identified packages, e.g. x11-video-nvidiaG0 and nvidia-gfxG0-kmp-default.
* To do this with Zypper. for example, execute:
zypper install x11-video-nvidiaG0 nvidia-gfxG0-kmp-default
5. Restart X (Logout and press--).
6. Enjoy!
6. The kernel update will trigger installation of new NVIDIA kernel drivers. This addition will leave the old versions present, they need to be removed manually. Run:
rpm -qa '*nvidia-gfx*'
If you have a new "nvidia-gfxG01-..." package in this list, you can remove the left over nvidia-gfx-... package(s).
[edit]
SUSE Linux 10.1 and SLED 10
*
o Add the YUM repository ftp://download.nvidia.com/novell/sle10sp1 to the package manager (YAST or ZEN).
It is very easy, most of the time.
WARNING: The NVIDIA driver RPMs for openSUSE 10.2 are built against the default kernel on the DVD and they should work after kernel updates provided trough YaST Online Update (YOU), but sometimes they don't, because the kernel update, forced by security reasons, broke compatibility with previous version. In this case you should follow instructions in the section The Hard Way to restore 3D.
1. Import the NVIDIA GnuPG key. Login in console as root user and type, or simply copy and paste using mouse:
rpm --import ftp://download.nvidia.com/opensuse/10.2/repodata/repomd.xml.key
2. Add the NVIDIA rpm-md repository: ftp://download.nvidia.com/opensuse/10.2/ to the package manager.
* To do this in YaST, go to Software -> Installation Source. Now hit Add and then select Specify URL. In there, enter the above URL and then hit Next, and then Finish.
* Or, to do this in Zypper execute:
zypper sa ftp://download.nvidia.com/opensuse/10.2/ nvidia
3. Identify which 'nvidia' driver packages you need. This depends on the exact model of your card. For a newer card you'll probably need x11-video-nvidiaG01 and nvidia-gfxG01-kmp-default packages. If your card is part of the NVIDIA Legacy then you'll need x11-video-nvidia and nvidia-gfx-kmp-default. (The list is taken from http://www.suse.de/~sndirsch/nvidia-installer-HOWTO.html)
If you are running on a non-default kernel flavour, you may need nvidia-gfxG0-kmp-bigsmp instead of nvidia-gfxG0-kmp-default (or nvidia-gfx-kmp-bigsmp instead of nvidia-gfx-kmp-default). "bigsmp" here is a your kernel flavor. You can find out your kernel flavor by running uname -r.
4. Install the identified packages, e.g. x11-video-nvidiaG0 and nvidia-gfxG0-kmp-default.
* To do this with Zypper. for example, execute:
zypper install x11-video-nvidiaG0 nvidia-gfxG0-kmp-default
5. Restart X (Logout and press
6. Enjoy!
6. The kernel update will trigger installation of new NVIDIA kernel drivers. This addition will leave the old versions present, they need to be removed manually. Run:
rpm -qa '*nvidia-gfx*'
If you have a new "nvidia-gfxG01-..." package in this list, you can remove the left over nvidia-gfx-... package(s).
[edit]
SUSE Linux 10.1 and SLED 10
*
o Add the YUM repository ftp://download.nvidia.com/novell/sle10sp1 to the package manager (YAST or ZEN).
Subscribe to:
Posts (Atom)
