I'm still confused. This code won't compile and nature of the errors make it hard to understand the
intention.
Constructors are integral to the Java language. You can't write anything beyond the most trivial
program without using constructors. Concepts related the use of constructors have little relevance
to discussions of WebDriver, beyond the requirement of understanding the language you are using to
access the WebDriver APIs.
Neither of the two lines you emphasized are using constructors. Well, sort-of, but not in a way that
would compile.
The phrasing of your question(s) and invalid code indicates that you have not yet mastered the
basics of the Java language....and perhaps that are having difficulty communicating the nature of
the question. I could be wrong, and I don't intend to offend, but that's just what I feel after
reading your messages.
So, I'm not quite sure how to help you here. My only suggestion is to study the Java language a bit
more, particularly constructors. Then write an example of valid Java code (i.e. make sure that it
compiles) and then come back with the question again. Hopefully I can better assist you at that point.
Chris
On 4/8/2014 1:38 AM, Paul Levesque wrote:
> May be I can better explain using an example:
>
> *1. When I am not using a constructor*
> public class FindElementin60 extends AllElements {
>
> // wait upto 60 secs and click - for text
> public void cliktxt(String locator){
> new WebDriverWait(driver, 60).until(
> ExpectedConditions.presenceOfElementLocated(By
> .linkText(locator))).click();
> }
> }
>
> public class SignUp extends AllElements{
>
> public void parentsignup(){
>
> driver = new FirefoxDriver();
> driver.get("
http://myschool.com);
> *FindElementin60.cliktxt("Sign up");*
>
> }
>
> }
>
> *2. When I am using a constructor *
>
> public class FindElementin60 extends AllElements {
> /*
> * using constructor of same name
> *
> */
> public FindElementin60() {
>
> class ClearIt{
>
> void txt(String locator) {
> new WebDriverWait(driver, 60).until(
> ExpectedConditions.presenceOfElementLocated(By
> .linkText(locator))).clear();
> }
>
> }
>
>
> }
>
> public class SignUp extends AllElements{
>
> public void parentsignup(){
>
> driver = new FirefoxDriver();
> driver.get("
http://myschool.com);
> *FindElementin60.ClearIt.txt("career_id");*
>
webdriver+...@googlegroups.com <javascript:>.
> To post to this group, send email to
webd...@googlegroups.com <javascript:>.
> <
http://groups.google.com/group/webdriver>.
> For more options, visit
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
>
webdriver+...@googlegroups.com <mailto:
webdriver+...@googlegroups.com>.
> To post to this group, send email to
webd...@googlegroups.com <mailto:
webd...@googlegroups.com>.
--
------------------------------------------------------------------------ -
Chris Merrill | Web Performance, Inc.
ch...@webperformance.com |
http://webperformance.com
919-433-1762 |
919-845-7601
Web Performance: Website Load Testing Software & Services
------------------------------------------------------------------------ -