Tuesday, May 20, 2014

Current working directory : http://stackoverflow.com/questions/4871051/getting-the-current-working-directory-in-java
Always while automating a web application through selenium webdriver, we come across a common problem to detect when page has loaded.

Below is a link to article where you can find a solution to detect when page has loaded.
http://stackoverflow.com/questions/5868439/wait-for-page-load-in-selenium

Thursday, May 8, 2014

To Edit cookie in Chrome

Go to console and type following javascript snippet
javascript:document.cookie="myCookieName=myCookieValue"
press ENTER

Tuesday, September 11, 2012

Problems in using Page Object Repository framework for selenium automation

Today I was googling to find a solution for problem of duplication of locators in writing my automation tests using selenium page object repository framework.

Due to this, maintenance of tests , if there comes new failure, becomes a hectic task. Doing so, I found a blog reference which helps me to find out a solution.

Save your locators as By objects
This allows you to solve all the problems listed above and I’ve also noticed a reduction in the number of StaleElementExceptions I run into as I have a lot more control about when an element is looked up and assigned to a variable.
My example of how I think a sample page object should look can be found here.
 Reference: From a blog by Lain Rose. His repository can be accessed at this location: https://github.com/iainrose/vanq-java

Thanks Lain Rose for sharing solution.

Feel free to post a comment here, if you have any doubt or question to ask.







Friday, September 7, 2012

Setting Selenium Grid Hub version-2.x and working with it

Not ready to re-write the text again. Better just share two nice links for finding information on how you can set up Grid Hub and work with the Selenium Grid.

Below are the links:
+ The official wiki page
+ Visit the blog of selenium expert - Krishnan Mahadevan

Feel free to post a comment here, if you have any doubt or question to ask.







Wednesday, September 5, 2012

Usual Problem in Firefox under heavy load.

@Problem: [Warning: Unresponsive script] message is being popped out in middle of test execution. Due to this test is getting failed.

@Description: A script on this page may be busy, or it may have stopped responding. You can stop the script now or you can continue to see if the script will complete.




@Why This Message: "[JavaScript] that executes for whole seconds is probably doing something wrong..." says Brendan Eich, creator of JavaScript. When a script is executing, Mozilla's UI will be unresponsive until the script’s thread ends. Correspondingly, Mozilla will alert you when a script is taking a long time to run and let you stop the script. This preference lets you define what "a long time" is.

You can set preference time according to your wish by following below steps:
1) Open Mozilla Firefox browser instance.
2) Type-in in address bar: about:config and press enter.



3) Firefox will give you [This might void your warranty!] message.
4) Click on [I'll be careful, I promise!] button.
5) Then will open preference page. Now type-in in search text box [dom.max] and press enter.



6)You will find two settings as below:
+ dom.max_chrome_script_run_time
+ dom.max_script_run_time
7) Set as you wish the values for wait time.
@Note: The value is a positive integer, determining the number of seconds of execution before warning. 0 and negative values are considered "forever." (Default value is 10; 5 in versions )


Reference

@NOTE: As far as selenium automation is concerned, above settings will not work as every test loads a new browser profile which does only contain basic default setting. Any custom settings will not load. So you have to achieve these settings for your test by writing code as below for appropriate target browser:

            FirefoxProfile profile = new FirefoxProfile();
            profile.setPreference("dom.max_chrome_script_run_time" , "999");
            profile.setPreference("dom.max_script_run_time" , "999");









Thursday, August 30, 2012

Hi Selenese!!!

Selenium officials have been maintaining an official blog where they have been putting all the information related to improvements, enhancements, research and future goals everything.Next is the link, I am sharing to you as well.



Follow selenium official blog post...