GavinR
GavinR

Reputation: 21

Using Selenium and Java for UAT Testers

I have a few questions around beginning Selenium, Webdrivers and Java and am trying to work out the scope of the task :)

I work for a mainly manual UAT team working in finance (normally input/verify/enquiry data entry screens on web/rumba systems) but have started to learn about test automation. Currently learning QTP / VB at work whenever possible. My background has XHTML, CSS but more than happy to learn about coding, and hopefully I can find an setup which can be shared with both more and less technically able colleagues.

I have looked at the Firefox IDE and understand that you can code in Selense HTML which would be great for some ppl. They can record, edit some regression tests then copy and tweak the data to cater for other scenarios etc.

However our basic hacked together QTP scripts are always data-driven, editing fields, exporting results and screenshots back to Excel etc. which the IDE cant handle; but we are not coders so might struggle with full on Java.

1.) Can code like the below be generated by the IDE (Selense TestCase?) tweaked a little then placed into a generic Java header/footer template taken from the net?

How come the below can look like this rather than normal Java?

This style of code below looks readable enough to be a good middle ground but is more advanced than the IDE.

@Test
public void testOpenTypeClick() throws Exception {
    selenium.open("/");
    selenium.click("link=Advanced search");
    selenium.waitForPageToLoad("30000");
    selenium.type("as_q", "selftechy, selenium");
    selenium.click("//input[@value='Advanced Search']");
    selenium.waitForPageToLoad("30000");
}

public void testSelectCheck() throws Exception {
    selenium.open("http://www.sqajobs.com/");
    selenium.click("link=Advanced Search");
    selenium.waitForPageToLoad("30000");
    selenium.type("bx_jtitle", "Sr. Testing Engineer");
    selenium.select("rdjt", "label=All Of These");
    selenium.removeSelection("jids[]", "label=All Categories");
    selenium.addSelection("jids[]", "label=Functional Testing");
    selenium.type("bx_kwd", "selenium");
    selenium.click("idrdKeyw1");
    selenium.click("id_alltype");
    selenium.check("id_jtp_1");
    selenium.uncheck("id_jtp_1");
    selenium.check("id_jtp_1");
    selenium.click("//input[@name='cmdSearch' and @value='  Search  ']");
    selenium.waitForPageToLoad("30000");
}

2.) How would you setup Selenium to work with code like the below? Can you just access the Client Drivers by coding a link in Eclipse and automate Firefox / IE as I doubt our company would allow the SeleniumServer to run on our PCs.

Appreciate any advice, sorry is the above is unclear as I am very new to coding so lack a strong understanding of terms.

Gav

Upvotes: 2

Views: 1101

Answers (2)

niharika_neo
niharika_neo

Reputation: 8531

It would make sense to go with Webdriver since it is being actively developed currently. If you have not started then I would suggest you go with a maven project which would help resolve all dependencies you need. Probably this can help : Using Webdriver

If your browser and your tests will run on the same machine, then you need not even have to start a server. Your tests would be as simple as

WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("Cheese!");

I would suggest you go through this which would give you a quick getting started overview.

Hope it helps.

Upvotes: 1

HemChe
HemChe

Reputation: 2337

Selenium server is just a jar file and you can place it in your system. Selenium server when configured with Eclipse along with Java client bindings will serve your purpose and if you are using a web based application, you can make the most out of selenium which will be useful for performing your UAT testing.

Upvotes: 0

Related Questions