RE: Test Case does not execute fully

Hi,
First of all thanks for such a nice and detailed tutorial on Selenium. I used your approach on Selenium Hybrid framework in exactly the same manner. But I am facing the below issue intermittently while executing my Test Case :

For example: I have 10 Test Steps written for a test case in DataEngine.xls. When I try to run it sometimes its executing all 10 steps, sometimes its executing 2 steps only and sometimes its executing 3 Steps. And if I see the logs it does not give any error like NoSuchElement found. It just ends the test like if there are no steps after those.Please suggest.

I have also put explicit wait conditions for an elements also , below is the function for click keyword function for your reference :


public static void click(String object, String data){

try{

wait = new WebDriverWait(driver,50);

wait.until(ExpectedConditions.elementToBeClickable(By.xpath(OR.getProperty(object))));

System.out.println("Clicking on Webelement "+ object);

Log.info("Clicking on Webelement "+ object);

driver.findElement(By.xpath(OR.getProperty(object))).click();

}catch(Exception e){

System.out.println("Not able to click --- " + object + e.getMessage());

Log.error("Not able to click --- " + object + e.getMessage());

DriverScript.bResult = false;

}

}

Here is what I see in Logs :
When It executed 3 Steps :
2014-11-21 12:01:54,649 INFO  [Log] ****************************************************************************************
2014-11-21 12:01:54,649 INFO  [Log] Opening Browser
2014-11-21 12:02:15,169 INFO  [Log] Firefox browser started
2014-11-21 12:02:16,105 INFO  [Log] Navigating to URL
2014-11-21 12:02:20,375 INFO  [Log] Entering the text in tbx_UserName
2014-11-21 12:02:21,068 INFO  [Log] Entering the text in tbx_Password
2014-11-21 12:02:22,229 INFO  [Log] Clicking on Webelement btn_LogIn
2014-11-21 12:02:22,731 INFO  [Log] XXXXXXXXXXXXXXXXXXXXXXX             -E—N—D-             XXXXXXXXXXXXXXXXXXXXXX

When It executed just 2 Steps and didn’t clicked Login :
************************
2014-11-21 12:04:57,106 INFO  [Log] ****************************************************************************************
2014-11-21 12:04:57,106 INFO  [Log] Opening Browser
2014-11-21 12:05:09,498 INFO  [Log] Firefox browser started
2014-11-21 12:05:09,873 INFO  [Log] Navigating to URL
2014-11-21 12:05:13,884 INFO  [Log] Entering the text in tbx_UserName
2014-11-21 12:05:14,711 INFO  [Log] Entering the text in tbx_Password
2014-11-21 12:05:15,132 INFO  [Log] XXXXXXXXXXXXXXXXXXXXXXX             -E—N—D-             XXXXXXXXXXXXXXXXXXXXXX

harshshridhar Default Asked on November 21, 2014 in Selenium WebDriver.
Add Comment
2 Answers

Hi friend,

Your question suggests towards “Login Button” Please try to locate the element/ object for this and do action on it. Your ErrorLogMessage shows the details

Train Answered on November 24, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.