Skip to main content

Posts

Showing posts with the label selenium remote

Simulating Keyboard strokes using Selenium1

Many a times we want to simulate keyboard strokes in our selenium tests. Here is how you can do this using Selenium1.   Command: selenium.keyPressNative(<KeyEvent_TobePassed>);   For Ex: If you want to simulate pressing Tab then you need to pass the command: selenium.keyPressNative(java.awt.event.KeyEvent.VK_TAB+"");   View the list of KeyEvents here: http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/event/KeyEvent.html   Hope this helps!

Issues Running Selenium Scripts Remotely

In real time we hardly have a simple setup like running on the same box which acts as a server and client :( So we might have to run the scripts remotely almost all the time...Well there might be issues while doing so...Here are some! Can't launch the browser at all: Check the host name you are using in your code first! There is a possibility that the DNS isn't able to map the hostname with the IP - so try running your tests specifying the IP instead of the hostname Check the path you provided to the executable of the browser - verify its found on the same path on your remote location Now the final check is to verify you can run the browser version on the RC version for ex: you can't run FF7 on RC1 :)  Browser Opens but tests aren't running This happens because the RC isn't able to talk to your browser - though it initiates the browser but can't talk to it anymore Solution: Upgrade your RC :)  Running on a Headless Box Selenium can't run u...