in reply to Re: To set values for a textbox in a Web application
in thread To set values for a textbox in a Web application

Hi Martin,
Thanks for your reply. I do accept that getTable call is wrong, that I've misplaced the colon, but apart from that the actual problem is that I just want to know why the error "can't call method readystate with undef value" is thrown.
Actual Scenario:
Our application login page has two textfileds username and password. These text fields are incorporated in tables associated with classes. I've used "getTable" of IEAutomation along with the name of the textfield "username". But still am getting the error "can't call method readystate with undef value". Again I've provided my code below. Appreciate your assistance.
use strict; use warnings; use win32::IEAutomation; use Win32::IEAutomation::Element; use Win32::IEAutomation::Table; use Win32::IEAutomation::WinClicker; my $IE = Win32::IEAutomation->new( visible => 1, maximize => 1); $IE->gotoURL('http://url') ; $IE->WaitforDone; $IE->getTable("class:", "as_txt_logincm_font_header_normal")->getTextB +ox('name:',"txtUserName")->SetValue('user1>');
Thank You,
Saravanan.S

Replies are listed 'Best First'.
Re^3: To set values for a textbox in a Web application
by marto (Cardinal) on Feb 11, 2009 at 14:15 UTC

    I think you have perhaps missed the point I tried to make, where in the documentation does it say you can use getTextBox in conjunction with getTable? Why didn't you simply modify my example to match your needs?:

    $ie->getTextBox('name:', "txtUserName")->SetValue("user1");

    Is there only one text box named txtUserName on the page? The documentation states "If there are more than one object having same value for the option you are quering, then it returns first object of the collection.".

    As I mentioned previously, I have never used Win32::IEAutomation, I tend to use WWW::Mechanize (Win32::IE::Mechanize at a push) which has (IMHO) better methods for filling in forms.

    Cheers,

    Martin