Thursday 15 May 2014

How to mouse hover on menu in Selenium webdriver or BDD in Java

How to mouse hover on menu in Selenium webdriver or BDD in Java
In this scenario let assume there are 6 main menu items are there and you have to mouse hover on all menus then  you can use this code.
Hint :- Below you have to change your css selector details as per your website.

Actions action = new Actions(driver);

            int numberOfSubMenu = 6;

            // Hovering over each of the items in the top menu and testing the menu items
            for (int j=2; j<= numberOfSubMenu; j++) {

                WebElement elem = driver.findElement(By.cssSelector(".sf-menunew>li:nth-child(" + j + ")>a:nth-child(1)"));
                action.moveToElement(elem);
                action.perform();
                Thread.sleep(1000);
                 
            }

Tuesday 13 May 2014

How to select size from dropdown in Selenium or BDD in Java


Select sele = new Select(driver.findElement(By.xpath("//*[contains(@id,'dropdown')]")));
           
            List<WebElement> sizeOptions = sele.getOptions();
            for(WebElement element: sizeOptions)
            {
                String sizeValue;
                String checkInStock = null;
                checkInStock = "In Stock";
               sizeValue = element.getText();
             
                if(sizeValue.contains(checkInStock)){
                    sele.selectByVisibleText(sizeValue);
                    System.out.println(sizeValue);
                   
                    break;
                }
            }
            Thread.sleep(1000);

Friday 9 May 2014

How to wait till a banner or image loads in selenium webdriver java


http://stackoverflow.com/questions/5868439/wait-for-page-load-in-selenium



https://code.google.com/p/selenium/issues/detail?id=5309
http://www.programcreek.com/java-api-examples/index.php?api=org.openqa.selenium.JavascriptExecutor
http://stackoverflow.com/questions/17208935/org-openqa-selenium-webdriverexception-referenceerror-jquery-is-not-defined
https://github.com/ChonC/wtbox/blob/master/src/wtbox/util/WaitTool.java

Wednesday 7 May 2014

Please make sure you have the correct access rights and the repository exists


$ git pull origin branch/OOP-123

ssh: git.proj.corp.com: no address associated with name
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


SOLUTION:

Your network is unable to connect to git server because it is unable to point the Git repository ip
Solution 1:
In your organization if you have multiple networks simply change your network to other network and try.

Solution2:
It is a permanent solution.

And it is DNS Settings problem and the machine simply could not reach the remote git repository.
Because you have to specify which DNS server have to use or which IP address should be used for a particular git domain.


DNA settings help :

It is good to ask your network administrator to setup these in oranization if you are not sure about these or else here
here you go for solution.

WAY1:

Map IP Addresses in hosts file.
This method allows you to create settings for individual domains without altering your main DNS preferences. This is useful if you don't have access to a DNS or if you want to specify the location of a single domain without interfering with any of your other online activities.

Open the following file in a plain text editor such as Notepad:
C:\WINDOWS\system32\drivers\etc\hosts

The file looks like the one below. At the end of the file (in this case, under the localhost entry), enter the IP and domain you wish to specify. When your browser attempts to access a domain it refers to this file first - if the domain is found here then the specified IP address will be used.
If the domain is not found here, then the normal DNS server (as specified above) will be used.


WAY 2:

Goto My Computer -> Dailup Networking
Right click your internet connection and select Properties
Window will open click the Server Types Tab and then click TCP/IP Settings.

Click Properties.

git no address associated with name fatal: Could not read from remote repository

When ever you try to pull some thing from Git it will give the below error

$ git pull origin branch/OOP-123

ssh: git.proj.corp.com: no address associated with name
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


SOLUTION:

Your network is unable to connect to git server because it is unable to point the Git repository ip
Solution 1:
In your organization if you have multiple networks simply change your network to other network and try.

Solution2:
It is a permanent solution.

And it is DNS Settings problem and the machine simply could not reach the remote git repository.
Because you have to specify which DNS server have to use or which IP address should be used for a particular git domain.


DNA settings help :

It is good to ask your network administrator to setup these in oranization if you are not sure about these or else here
here you go for solution.

WAY1:

Map IP Addresses in hosts file.
This method allows you to create settings for individual domains without altering your main DNS preferences. This is useful if you don't have access to a DNS or if you want to specify the location of a single domain without interfering with any of your other online activities.

Open the following file in a plain text editor such as Notepad:
C:\WINDOWS\system32\drivers\etc\hosts

The file looks like the one below. At the end of the file (in this case, under the localhost entry), enter the IP and domain you wish to specify. When your browser attempts to access a domain it refers to this file first - if the domain is found here then the specified IP address will be used.
If the domain is not found here, then the normal DNS server (as specified above) will be used.


WAY 2:

Goto My Computer -> Dailup Networking
Right click your internet connection and select Properties
Window will open click the Server Types Tab and then click TCP/IP Settings.

Click Properties.

Website application security testing


https://www.randomstorm.com/services/web-application-assessments/?gclid=COqHn-S5mb4CFccSwwodBTcALQ

http://www.pgistrontium.com/our-services/penetration-testing

Friday 2 May 2014

SVN Commit has encountered a problem svn: Unable to connect to a repository RA layer request failed

org.apache.subversion.javahl.ClientException:RA layer request failed

svn commit failed
svn unable to connect to a repository at URL
Svn url

Solution: 

For this problem you have to check network is connected or not change network and try it will work.


SVN comment template

DDD-234 - User Name #comment updated credit card expiry date