Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

how to capture time/number of results in google results page

View previous topic View next topic Go down

how to capture time/number of results in google results page

Post by manukvk on Wed Aug 11, 2010 6:39 pm

I got a small trouble while using selenium in IDE 1.0.5 .I need to capture a value and retrieve back for example in google page , after results are displayed i need to capture value of time it took.Iam enclosing the code used by me to do it.when i run this i got a NULL value .Please help me out.


public void testtest() {
selenium.open("/firefox?client=firefox-a&rls=org.mozilla:en-US:official");
selenium.type("sf", "SACHIN");
selenium.click("btnG");
selenium.waitForPageToLoad("30000");
String i = selenium.getValue("//div[@id="resultStats"]");
Reporter.log(i);
}

manukvk

Posts : 1
Join date : 2010-08-11

Back to top Go down

Re: how to capture time/number of results in google results page

Post by Adviser on Sun Aug 15, 2010 11:49 am

hi,

Try this code




public void testUntitled 2() throws Exception
{
selenium.open("http://www.google.co.in/");
selenium.type("q", "selenium");
selenium.click("btnG");
verifyTrue(selenium.isElementPresent("resultStats"));
String var2 = selenium.getText("resultStats");
selenium.type("q", var2);
}
}


Best of luck

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: how to capture time/number of results in google results page

Post by uma maheswari on Fri Oct 22, 2010 8:20 pm

Hai adviser,

-I tryed the coding what you given which is above,but for me not working.
-For me

package ss;

import java.util.regex.Pattern;
import com.thoughtworks.selenium.*;

public class form extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://www.google.co.in/", "*chrome");
}
public void testform() throws Exception
{
selenium.open("/");
selenium.type("q", "selenium");
selenium.click("btnG");
verifyTrue(selenium.isElementPresent("//ol[@id='rso']/li[8]/h3/a/em"));
//verifyTrue(selenium.isElementPresent("SELENIUM"));
String var2 = selenium.getText("//ol[@id='rso']/li[8]/h3/a/em");
selenium.type("q", var2);

}
}


while using this,how will i capture the time?error occuring like

"com.thoughtworks.selenium.SeleniumException: ERROR: Element //ol[@id='rso']/li[8]/h3/a/em not found

Please help me.

Thanks in advance


Regards
uma

uma maheswari
Active particpant
Active particpant

Posts : 12
Join date : 2010-10-19

Back to top Go down

Re: how to capture time/number of results in google results page

Post by Priyanka on Tue Oct 26, 2010 11:57 am

Hi Uma,


Please insert a command "selenium.WaitForPageToLoad("30000");" before verifying the element present. Like below

selenium.Click("btnG");
selenium.WaitForPageToLoad("30000");
verifyTrue(selenium.isElementPresent("//ol[@id='rso']/li[8]/h3/a/em"));

Please try it...

Priyanka
Regular Participant
Regular Participant

Posts : 27
Join date : 2010-10-04

Back to top Go down

Re: how to capture time/number of results in google results page

Post by ash_tha on Mon Nov 22, 2010 6:01 pm


I am Ashish and I have over 5 years of exp in automation testing and have worked on various automation as well as load testing tools.
I teach selenium and QTP online as part time stuff.

- First class is trial class.
- Video of class will be provided
- 1 hour per day. 48 days course. 5 days a week
- Small batch size of 3-4 students max
- English will be the course language
- Course fee is INR 12000 (USD265$). Half the fee has to be paid after trial class. Half after IDE is over.
You can go to following link for details and registration:
http://www.sejsoft.com/training/java_training.php

OR

You can write a mail at automation@sejsoft.com or itsthakur@gmail.com

ash_tha

Posts : 5
Join date : 2010-11-22

Back to top Go down

Re: how to capture time/number of results in google results page

Post by Sponsored content Today at 9:07 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum