Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
manukvk
Posts : 1
Join date : 2010-08-11

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

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);
}
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

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

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
avatar
uma maheswari
Active particpant
Active particpant
Posts : 12
Join date : 2010-10-19

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

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
avatar
Priyanka
Regular Participant
Regular Participant
Posts : 27
Join date : 2010-10-04

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

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...
avatar
ash_tha
Posts : 5
Join date : 2010-11-22

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

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
Sponsored content

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

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