Quality Testing

Quality is delighting customers

Scenario1:

1) Launch browser
2) Open http://www.quikr.com/ site
3) Wait up to 2 sec ,choose your location pop up will comes up
4) How can I give my location while script running time

Thanks,

Subbu

Views: 300

Reply to This

Replies to This Discussion

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class QickerIndex {

public static void main(String[] args) throws InterruptedException {

// TODO Auto-generated method stub

WebDriver driver = new FirefoxDriver();

driver.manage().window().maximize();

driver.get("http://www.quikr.com/");

Thread.sleep(1000);

driver.findElement(By.linkText("Ahmedabad")).click();

}

}

Hi Vinay Panday,
thank you very much for your quick reply. i had tried and script was executed successfully but i want to enter my location manually while script execution time, please find below example for your reference
Ex:
 //Enter user id & password while running time
   Scanner sc=new Scanner(System.in);
   System.out.println("Enter your personal email id:");
   String id=sc.nextLine();
   System.out.println("Enter your password:");
   String pass=sc.nextLine();
   System.out.println("Enter conform passward:");
   String cpass=sc.nextLine();
   System.out.println("Enter your mobile Number:");
   String mb=sc.nextLine();

Welcome  subramanyam,

Just use 

Thread.sleep(1000); 

if you are using thread.sleep(1000); enter the time as much time you need. google it if you don't get let me know.

another option is code given below just give the number of second you want to wait ->> for example i am using 15 sec to wait.

use both code before submit button.

driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service