Display results as :

Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by


Element is not found exception

View previous topic View next topic Go down

Element is not found exception

Post by keerthi on Mon Mar 07, 2011 2:32 pm

i am using selenium for generating script ,if i run the script then i am getting element not found exception.

this is my script file:

//* 1. To test all the module links are working are not.
package TestPackage;

import com.thoughtworks.selenium.*;

public class all extends SeleneseTestCase {
public void setUp() throws Exception {
//run in local

// run from the server
// setUp("",
// "*chrome");

public void testall() throws Exception {"/nirvahak/login.jsp");"/bachpan/login.jsp");
selenium.type("j_username", "rekha");
selenium.type("j_password", "rekha");"submit");
//search staff
//showing a error as search staff not found."action-search-staff");
//Add a new staff"staff-add");
selenium.type("username", "keerthi");
selenium.type("password", "keerthi");
selenium.type("firstName", "keerthi");
selenium.type("lastName", "kr");
selenium.type("employeeNumber", "1243");"staffType", "label=Teacher");
selenium.addSelection("subjects", "label=Maths");
selenium.addSelection("subjects", "label=Telugu");
selenium.addSelection("subjects", "label=English");"button-next");
selenium.type("mobile", "9685745210");
selenium.type("residencePhone", "0401253645");
selenium.type("fatherName", "Mani");
selenium.type("motherName", "Padma");
selenium.type("bloodGroup", "A");
selenium.type("nationality", "India");"button-next");
selenium.type("addressLine1", "Near sathysai nigam hyderabad");
selenium.type("locality", "Sreenagar colony");
selenium.type("landmark", "Sathy sai nigam");
selenium.type("city", "Hyd");
selenium.type("state", "Ap");
selenium.type("pincode", "500073");"button-next");"css=div[id="button-save"]");"staff-search");"action-search-staff");
selenium.type("username", "keerthikasaram");"action-search-staff");
selenium.type("username", "keerthi");"action-search-staff");"staff-exp-coll");"staff-exp-coll");"//a/img");
//Search task
// Add task"task-add");"assignedToStaffId", "label=regexp:Akash\\sraz");"priority", "label=High");"status", "label=Waiting on someone else");
selenium.type("taskTitle", "a");
selenium.type("//textarea[@name='description']", "as");"css=div[id="button-save"]");"task-search");"//a/img");
// Add transport"//li[2]/span/a/img");
selenium.type("registrationNo","Ap 22 St 5678") ;
selenium.type("gasType","gas" );
selenium.type("modelNo", "flat");
selenium.type("vehicleMake", "maruthi");
selenium.type("insuranceNo", "12345712523");
selenium.type("insuranceCompany", "Baja aliance");
selenium.type("insuranceExpiry", "2013");"ownershipType", "label=Rent");"rent");
selenium.type("//input[@id='ownerName']", "rani");
selenium.type("serviceDueDate", "3.3.2011");"css=div[id="action-save"]");
//Add expenses search expense"/nirvahak/index.jsp");"//li[2]/span/a/img");
selenium.waitForPageToLoad("30000");"/nirvahak/index.jsp?module=transport&page=transport");"add-expense");"transportId", "label=Ap 22 St 5678");
selenium.type("paymentAmount", "1000");
selenium.type("paymentMode", "cash");
selenium.type("paymentDate", "2.3.2011");"css=div[id="action-save"]");"search-expense");"action-search-transport-expense");


some of the ids ,selenium tool is not recognized.

at the line"action-search-task"); ,here i am getting exception.

if i run the script in debug mode then it is working.

please provide solution.


Posts : 2
Join date : 2011-03-04

Back to top Go down

Re: Element is not found exception

Post by Priyanka on Tue Mar 08, 2011 11:54 am

Can u pls use selenium.waitForPageToLoad("30000"); or thread.sleep command after click command..may be this will help u to identify the element

Regular Participant
Regular Participant

Posts : 27
Join date : 2010-10-04

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum