Can't find the UI input object

46 de afișări
Accesați primul mesaj necitit

KillerTom

necitită,
8 iul. 2010, 05:10:1208.07.2010
– watij
Hi
I try the statement as below:

Spec spec = new Spec().mozilla();
spec.open("http://www.w3schools.com/js/tryit.asp?
filename=try_dom_text_name");
spec.pauseUntilReady();
spec.find("input").with("name=='email'").with("id=='email'").with("type='text'").set("value='st'");

But it always get the exception:Expectation failed: Element should
exist before calling value='st'
Do you know what wrong is?
Thanks
Tom

KillerTom

necitită,
9 iul. 2010, 05:06:5309.07.2010
– watij
Another problem, when i test on firefox,it works fine.But it can'g
work on IE.
Even through i use the spec.find("*").all().set("value='st'"); It
still can't find the element and prompt the exception as below:
Exception in thread "main" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:417)
at java.lang.Integer.valueOf(Integer.java:554)
at org.watij.webspec.dsl.Tag.length(Tag.java:28)
at org.watij.webspec.dsl.All.length(All.java:13)
at org.watij.webspec.dsl.All.set(All.java:25)
at test.LoginHome1(test.java:19)
at test.main(test.java:37)


On Jul 8, 5:10 pm, KillerTom <killerto...@sina.com> wrote:
> Hi
> I try the statement as below:
>
> Spec spec = new Spec().mozilla();
> spec.open("http://www.w3schools.com/js/tryit.asp?
> filename=try_dom_text_name");
> spec.pauseUntilReady();
> spec.find("input").with("name=='email'").with("id=='email'").with("type='te­xt'").set("value='st'");

Brian Knorr

necitită,
11 iul. 2010, 20:18:5111.07.2010
– wa...@googlegroups.com
I think you want:

with("type=='text'")

and not:

with("type='text'")

Also find("*") is not supported...you basically asked for the tag called "*"....which doesn't exist.  WebSpec requires you to name the tag like "input", "div", "textarea", etc...this is for performance reasons.



--
You received this message because you are subscribed to the Google Groups "watij" group.
To post to this group, send email to wa...@googlegroups.com.
To unsubscribe from this group, send email to watij+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/watij?hl=en.




--
Brian Knorr
Dallas, Texas
http://www.starterstep.com

KillerTom

necitită,
11 iul. 2010, 21:51:2311.07.2010
– watij
I changed it to spec.find("input").all().set("value='st'");
My concern is our company's application works fine on firefox,but it
can't work on IE.It can't find any element on IE for our company's
application.
But it works fine for google on IE.So it is strange.
> > watij+un...@googlegroups.com <watij%2Bunsu...@googlegroups.com>.
> > For more options, visit this group at
> >http://groups.google.com/group/watij?hl=en.
>
> --
> Brian Knorr
> Dallas, Texashttp://www.starterstep.com- Hide quoted text -
>
> - Show quoted text -
Răspundeți tuturor
Răspundeți autorului
Redirecționați
0 mesaje noi