- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Problem with waitForPageToLoad()
Tue Oct 25, 2011 5:14 pm
Hi All,
step 1): selenium.click("id=signIn");
step 2): selenium.waitForPageToLoad("30000");
step 3): selenium.click("id=signOut");
Sometimes i am getting exception while executing step 3).
So i increased the waitForPageToLoad from 30 sec to 100sec, even though i am
getting exception element id=signOut not found.
how to use selenium.clickAndWait() in selenium rc ?
step 1): selenium.click("id=signIn");
step 2): selenium.waitForPageToLoad("30000");
step 3): selenium.click("id=signOut");
Sometimes i am getting exception while executing step 3).
So i increased the waitForPageToLoad from 30 sec to 100sec, even though i am
getting exception element id=signOut not found.
how to use selenium.clickAndWait() in selenium rc ?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Wed Oct 26, 2011 1:57 pm
Did you try
- Code:
selenium.clickAndWait("id=signIn");
- Code:
selenium.clickAndWait("id=signOut");
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Thu Oct 27, 2011 12:36 pm
I tried
but showing error
- Code:
selenium.clickAndWait("id=signIn");
but showing error
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Thu Oct 27, 2011 1:20 pm
What error exactly?
Maybe this topic will help http://www.qualitytesting.info/forum/topics/does-selenium-rc-support?xg_source=activity
Maybe this topic will help http://www.qualitytesting.info/forum/topics/does-selenium-rc-support?xg_source=activity
- freeskyAmateur
- Posts : 72
Join date : 2011-04-13
Re: Problem with waitForPageToLoad()
Thu Oct 27, 2011 4:40 pm
what's the environment? what're the steps? what's the error? Pls more detail so that other people can help you more quickly.
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Thu Oct 27, 2011 5:01 pm
I am using Selenium RC with java as client driver.
I mean showing error means that there is no much method Selenium RC 1.0 api.
Actually i am testing gmail sign in & sign out functionality.
Upto sign in it is working fine, after that i am clicking on sent mail and then sign out.
Sometimes this process is working fine and other times it's not working.So i thought before page loading only, selenium server is checking for the element "Sent mail".
I tried with
But it is throwing selenium exception : Time out after 8000 ms
this method
I mean showing error means that there is no much method Selenium RC 1.0 api.
Actually i am testing gmail sign in & sign out functionality.
Upto sign in it is working fine, after that i am clicking on sent mail and then sign out.
Sometimes this process is working fine and other times it's not working.So i thought before page loading only, selenium server is checking for the element "Sent mail".
I tried with
- Code:
waitForCondition((selenium.isElementPresent("link=Sent Mail") == true?"true":"false"),"8000");
But it is throwing selenium exception : Time out after 8000 ms
this method
- Code:
selenium.isElementPresent("link=Sent Mail") == true?"true":"false";
- freeskyAmateur
- Posts : 72
Join date : 2011-04-13
Re: Problem with waitForPageToLoad()
Fri Oct 28, 2011 8:44 am
clickAndWait() is a command of IDE, but not exist in RC.
in RC, the clickAndWait is broke down 'click' and 'watiForPageToLoad("3000").
And in RC, the code should be :
for (int second = 0;; second++) {
if (second >= 60) fail("timeout");
try { if (selenium.isElementPresent("//div[@id="1"]")) break; } catch (Exception e) {}
Thread.sleep(1000);
}
not only selenium.isElementPresent("//div[@id="1"]").
If it's still existing the error, you can try to make the 'second' more longer.
in RC, the clickAndWait is broke down 'click' and 'watiForPageToLoad("3000").
And in RC, the code should be :
for (int second = 0;; second++) {
if (second >= 60) fail("timeout");
try { if (selenium.isElementPresent("//div[@id="1"]")) break; } catch (Exception e) {}
Thread.sleep(1000);
}
not only selenium.isElementPresent("//div[@id="1"]").
If it's still existing the error, you can try to make the 'second' more longer.
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Fri Oct 28, 2011 3:09 pm
freesky wrote:clickAndWait() is a command of IDE, but not exist in RC.
You are not right. There is clickAndWait() command in Selenium RC. I'm using Selenium RC with PHPUnit.
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Mon Oct 31, 2011 12:05 pm
Thanks for all of your suggestions.
Now it's working.
I increased the timeout value for waitForCondition() from 8000ms to 30000 ms.
And also i used
But now another problem arises
While clicking for inbox, i used
According to Selenium doc, it is better to use "href" when link is dynamically changing. so i record the inbox clicking as
Now it's working.
I increased the timeout value for waitForCondition() from 8000ms to 30000 ms.
And also i used
- Code:
selenium.setSpeed(5000);
But now another problem arises
While clicking for inbox, i used
- Code:
selenium.click("link=Inbox ");
- Code:
selenium.click("link=Inbox (1)");
According to Selenium doc, it is better to use "href" when link is dynamically changing. so i record the inbox clicking as
- Code:
selenium.click("//a[contains(@href, 'https://mail.google.com/mail/?shva=1#inbox')]");
elemnet not found Exception
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Mon Oct 31, 2011 2:12 pm
You should try:
- Code:
selenium.click("//a[contains(text(), 'Inbox')]");
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Mon Oct 31, 2011 4:43 pm
When a new mail or unread mails in Inbox then the below method changes fromfaramka wrote:
- Code:
selenium.click("//a[contains(text(), 'Inbox')]");
- Code:
selenium.click("//a[contains(text(), 'Inbox')]");
- Code:
selenium.click("//a[contains(text(), 'Inbox(1)')]");
So i need to modify my script every time, whenever i wants to run this.
How to uniquely identify the inbox( dynamically changing element)?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Mon Oct 31, 2011 4:53 pm
Is the second parameter of contains() variable or just a string ('Inbox')?
When you use
Hmmm, one main question: do you want to open inbox just when there is a new mail or always (regardless of whether there is something new)?
When you use
- Code:
selenium.click("//a[contains(text(), 'Inbox')]");
Hmmm, one main question: do you want to open inbox just when there is a new mail or always (regardless of whether there is something new)?
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Mon Oct 31, 2011 8:14 pm
faramka wrote:
Hmmm, one main question: do you want to open inbox just when there is a new mail or always (regardless of whether there is something new)?
I want to click on Inbox always whether a new mail comes or not.
But when i am trying to record clicking on a particular mail through selenium ide, it's not recording.
How to achieve mail clicking in gmail?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Mon Oct 31, 2011 9:12 pm
So what do you want to do now? Open Inbox or open & get one particular email?
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Tue Nov 01, 2011 11:51 am
open Inbox and then click & open one particular email from displayed mails list?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Wed Nov 02, 2011 2:41 pm
Now you know how to open Inbox. You can check length of this link's text
- Code:
a[contains(text(), 'Inbox')]
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Wed Nov 02, 2011 4:08 pm
Hi Faramka,
Thank you very much for the reply.
I tried like this:
I noticed one issue that Gmail is in sometimes iframes and other times as tables.
If it is in tables then Selenium IDE is recording clicking on a particular mail.
If it is in iframes then it IDE is not recording clicking on a particular mail.
What should i do if i want to open a particular mail even though any number of new mails arrives into Inbox?
Pls correct me if i had done anything wrong.
Regards,
Susmitha
Thank you very much for the reply.
I tried like this:
- Code:
selenium.isElementPresent("//table[@id='pd']//tr[1]/td[3]") // returns false;
selenium.isElementPresent("//table[@id='pd']") // returns false;
I noticed one issue that Gmail is in sometimes iframes and other times as tables.
If it is in tables then Selenium IDE is recording clicking on a particular mail.
If it is in iframes then it IDE is not recording clicking on a particular mail.
What should i do if i want to open a particular mail even though any number of new mails arrives into Inbox?
Pls correct me if i had done anything wrong.
Regards,
Susmitha
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Wed Nov 02, 2011 5:31 pm
Do you know (or can you define) what does it depend? Does it depend on the web browser? I have checked it in Chrome and then in Firefox - in both cases I see mails in the table.susmitha wrote:I noticed one issue that Gmail is in sometimes iframes and other times as tables.
Could you show some code with iframes?
You can check the page (Inbox page) and determine if there is the table with mails and do specific operations depending on type of gmail (iframes or tables).
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Wed Nov 02, 2011 8:25 pm
Mails are in table only.
But the code
But i resolved clicking on one of the dispalyed inbox mails using these methods
But the code
- Code:
<iframe id="canvas_frame" class="cO" frameborder="0" title="main" src="?ui=2&view=bsp&ver=ohhl4rw8mbn4" name="ce7n1unwur0c">
But i resolved clicking on one of the dispalyed inbox mails using these methods
- Code:
selenium.isElementPresent("//html/body/div/div[2]/div/div[2]/div/div[2]/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div[7]/div/div/table/tbody/tr[4]/td[3]/div/span/span"));
- Code:
selenium.clickAt("//html/body/div/div[2]/div/div[2]/div/div[2]/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div[7]/div/div/table/tbody/tr[4]/td[3]/div/span/span", "");
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Wed Nov 02, 2011 8:37 pm
Mails are in table only.
But the code
But i resolved clicking on one of the dispalyed inbox mails using these methods
But the code
- Code:
<iframe id="canvas_frame" class="cO" frameborder="0" title="main" src="?ui=2&view=bsp&ver=ohhl4rw8mbn4" name="ce7n1unwur0c">
But i resolved clicking on one of the dispalyed inbox mails using these methods
- Code:
selenium.isElementPresent("//html/body/div/div[2]/div/div[2]/div/div[2]/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div[7]/div/div/table/tbody/tr[4]/td[3]/div/span/span"));
- Code:
selenium.clickAt("//html/body/div/div[2]/div/div[2]/div/div[2]/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div[7]/div/div/table/tbody/tr[4]/td[3]/div/span/span", "");
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Problem with waitForPageToLoad()
Thu Nov 03, 2011 7:35 pm
OK
I think, you don't need to use clickAt method, 'cause you don't use coordinates and the second parameter of this method stays empty. Just try with click method.
I think, you don't need to use clickAt method, 'cause you don't use coordinates and the second parameter of this method stays empty. Just try with click method.
- susmithaActive particpant
- Posts : 15
Join date : 2011-10-21
Re: Problem with waitForPageToLoad()
Fri Nov 04, 2011 12:32 pm
faramka wrote:OK
I think, you don't need to use clickAt method, 'cause you don't use coordinates and the second parameter of this method stays empty. Just try with click method.
Thank you very much.
But clickAt() with empty coordinates is working for me.
- venkatkoritala
- Posts : 6
Join date : 2012-11-22
Re: Problem with waitForPageToLoad()
Thu Dec 13, 2012 4:23 pm
susmitha wrote:I tried
- Code:
selenium.clickAndWait("id=signIn");
but showing error
there is no clickAndWait() method in selenium rc
Permissions in this forum:
You cannot reply to topics in this forum
|
|