Share
View previous topicGo downView next topic
avatar
Archana
Regular Participant
Regular Participant
Posts : 33
Join date : 2009-08-21

File type validation

on Wed Aug 26, 2009 9:28 pm
Hi,
I have set “signed.applets.codebase_principal_support” set to the value “true” in my Mozilla.

In my selenium IDE, the below testcase (HTML format) is running fine.
type | trophy_image | C:\Documents and Settings\Administrator\Desktop\1.txt
click | submit
waitForAlert | Invalid Image file

But, Equivalent PHP-sel RC testcase is giving exception when I run in iexplore (In mozilla, its fine)

$this->type("trophy_image", "C:\\Documents and Settings\\Administrator\\Desktop\\1.txt");
$this->click("submit");
for ($second = 0; ; $second++) {
if ($second >= 60) $this->fail("timeout");
try {
if ("Invalid image file"== $this->getAlert()) break;
} catch (Exception $e) {}
sleep(1);
}

is giving timeout.

What's the problem here? I think as it is security issue, IE is not allowing to type in to text field. How to solve this issue?
avatar
Archana
Regular Participant
Regular Participant
Posts : 33
Join date : 2009-08-21

Re: File type validation

on Mon Aug 31, 2009 8:03 pm
Pls do reply any one! Thanks in advance.
avatar
Archana
Regular Participant
Regular Participant
Posts : 33
Join date : 2009-08-21

Re: File type validation

on Fri Sep 11, 2009 7:02 pm
Hi, Any ideas to solve my problem? Sad
nellorekrishnakumar
Active particpant
Active particpant
Posts : 19
Join date : 2009-08-14
Age : 32
Location : HYDERABAD

Re: File type validation

on Sat Sep 12, 2009 12:49 pm
Hi Archana,

Selenium performance in IE is slow when compared to firefox , try to put wait command and try to execute ur script in selenium.

Thanks,
Nellore Krishna Kumar
mugenhere
Posts : 9
Join date : 2009-09-08

Re: File type validation

on Mon Sep 14, 2009 2:01 am
Did you try printing $this->getAlert()? Try that inside the loop to see what is being compared with what.
The value you are comparing it with might differ slightly or maybe the value is not being fetched from the page.

Some code suggestions: 1)It seems you need a do-while/while loop
2) ($this->getAlert() == "Invalid image file") is more readable than (Invalid image file"== $this->getAlert())
Sponsored content

Re: File type validation

View previous topicBack to topView next topic
Permissions in this forum:
You cannot reply to topics in this forum