Quality Testing

Quality is delighting customers

Hi Team,

Can anyone help me,

I was just trying to automate search of Flight application.

I was able to record and replay the booking of Flight application using IDE.

where as the same when i try using RC , i see "oops there is no flight".

Can anyone let me know what might be the reason.

Thanks,

Riyazul

Views: 2302

Reply to This

Replies to This Discussion

Copy paste the code you are using.... let me check what could be the reason.

I have tried automating the flight application, with no issues. 

Regards,

Arvi, Admin QTP help

Hi Arvi,

Please find :

package com.example.tests1;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

@SuppressWarnings("

deprecation")
public class Southwest extends SeleneseTestCase {

@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.southwest.com/");
selenium.start();
}

@Test
public void testSearch_Flight() throws Exception {
selenium.open("/");
selenium.windowMaximize();
selenium.click("id=oneWay");
selenium.type("id=originAirport_displayed", "Dallas (Love Field), TX - DAL");
selenium.type("id=destinationAirport_displayed", "Austin, TX - AUS");
selenium.click("id=outboundDateAir");
Thread.sleep(5000);
selenium.click("css=img[class='ui-datepicker-trigger']");

selenium.click("link=26");

selenium.click("id=adultPassengerCount");

selenium.click("id=adultPassengerCount");

selenium.click("id=seniorPassengerCount");

selenium.select("id=seniorPassengerCount", "label=2 Seniors");

selenium.click("css=#seniorPassengerCount > option[value=\"2\"]");

pause(5000);
//selenium.keyPress("booking_widget_content_row_btn_search", "\\13");
selenium.click("css=input[id='booking_widget_content_row_btn_search']");

selenium.waitForPageToLoad("30000");
assertEquals("Southwest Airlines - Select Flight(s)", selenium.getTitle());
}

@After
public void tearDown() throws Exception {
selenium.stop();
}
}
For Test i tried with presskey as well plz find the test code :
@Test
public void testSearch_Flight() throws Exception {
selenium.open("/");
selenium.windowMaximize();
Thread.sleep(5000);
Robot r =new Robot();
selenium.click("id=oneWay");
Thread.sleep(5000);
selenium.focus("originAirport_displayed");
r.keyPress(KeyEvent.VK_TAB); 
r.keyRelease(KeyEvent.VK_TAB); 
//selenium.keyPress("originAirport_displayed", "");
Thread.sleep(5000);
selenium.type("id=originAirport_displayed", "Dallas (Love Field), TX - DAL");
Thread.sleep(5000);
selenium.focus("destinationAirport_displayed");
r.keyPress(KeyEvent.VK_TAB); 
r.keyRelease(KeyEvent.VK_TAB); 
//selenium.keyUp("originAirport_displayed", "");
//selenium.keyPressNative(java.awt.event.KeyEvent.VK_TAB + "originAirport_displayed");
Thread.sleep(5000);
selenium.type("id=destinationAirport_displayed", "Austin, TX - AUS");
Thread.sleep(5000);
selenium.click("id=outboundDateAir");
Thread.sleep(5000);
selenium.click("css=img[class='ui-datepicker-trigger']");
Thread.sleep(1000);
selenium.click("link=26");
selenium.click("id=adultPassengerCount");
Thread.sleep(1000);
selenium.click("id=adultPassengerCount");
Thread.sleep(1000);
selenium.click("id=seniorPassengerCount");
Thread.sleep(1000);
selenium.select("id=seniorPassengerCount", "label=2 Seniors");
Thread.sleep(1000);
selenium.click("css=#seniorPassengerCount > option[value=\"2\"]");
pause(5000);
//selenium.keyPress("booking_widget_content_row_btn_search", "\\13");
selenium.click("css=input[id='booking_widget_content_row_btn_search']");
selenium.waitForPageToLoad("30000");
assertEquals("Southwest Airlines - Select Flight(s)", selenium.getTitle());

Hi Riyazul Abbas

i would thank to reply the Arvi commends.this is Kannan currently i am working as software test engineer(manual) based on chennai.i interest to learn the selenium tool. Please help me to learn the tool quickly . i search the lot materials to read the selenium . but i cant.

Please boss help me .

If u have any document Ple share the below email id:skannanmcankl@gmail.com

Hi Kannan,

Good to hear that you want to learn selenium.

Belive me there is no Books or good material available which will make your job easy.

Only one way is explore and try.

I want you to try on ur own,

Incase at the last stage approach me i will teach you as per my availability.

Hi Riyazul, 

You know what, when I dry-ran your code manually, i got the same error message. That said - The code is absolutely fine and works as intended.

With respect to Selenium, you have already taken the first step to learn (any tool). Getting your hand dirty... Try automating as many scripts as possible, you should be good. Let me know if you run into issues, I will be glad to help you. Even I am from Chennai, I will pass on my number to you once I get back to India.

Regards,

Arvi, QTP help

hi arvi

thks for ur replay i will try to learn quickly . if i found any issue i will contact u.

regards

kannan.s

Hi Arvi,

EOD i see still i don't get the resolution for my script.

I'm trying,still. can you provide me the resolution, that would be great.

BY seeing ur answers it looks like we cannot automate the above scenario

Thanks,

Riyazul

Riyazul,

Looks like you did nor read my earlier post properly. What happens when you try your code steps manually (without executing the script), when I did I got the error message. Which means the code is perfectly right but the application is behaving that way.... Also, you may want to try Web Driver instead of RC.

Let me know if you still have concerns.

BTW, I dont live in your time zone. So, dont expect swift responses during your day.

Regards,

Arvi, QTP help.com

Hi A

Hi Arvi,

i found the solution, Please find the Code : 

@Test

public void testSouthWest() throws Exception {
selenium.setTimeout("90000");
selenium.open("/");
selenium.windowMaximize();
pause(20000);
selenium.click("id=oneWay");
//selenium.type("id=originAirport_displayed", "Dallas (Love Field), TX - DAL");
//selenium.type("id=destinationAirport_displayed", "Austin, TX - AUS");
selenium.clickAt("originAirport_displayed", "");
selenium.typeKeys("originAirport_displayed", "Dallas (Love Field), TX - DAL");
selenium.keyDown("originAirport_displayed", "\\9");
selenium.keyUp("originAirport_displayed", "\\9");
selenium.clickAt("destinationAirport_displayed", "");
selenium.typeKeys("id=destinationAirport_displayed", "Austin, TX - AUS");
selenium.keyDown("destinationAirport_displayed", "\\9");
selenium.keyUp("destinationAirport_displayed", "\\9");
selenium.click("id=outboundDateAir");
Thread.sleep(5000);
selenium.click("css=img[class='ui-datepicker-trigger']");
selenium.click("link=26");
selenium.select("id=seniorPassengerCount", "label=2 Seniors");
selenium.click("css=#seniorPassengerCount > option[value=\"2\"]");
pause(5000);
selenium.click("css=input[id='booking_widget_content_row_btn_search']");
for(int second = 0;; second++) {
if (second >= 60) fail("timeout");
try {

if ("Southwest Airlines - Search Fares, Book Flights".equals(selenium.getTitle())) break; }

catch (Exception e) {}
Thread.sleep(1000);
}
//selenium.waitForPageToLoad("30000");
assertEquals("Southwest Airlines - Search Fares, Book Flights", selenium.getTitle());
pause(30000);
}

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2022   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service