Display results as :

Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara


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