Write a automation test case to create a new account in NPU online application /
ID: 645570 • Letter: W
Question
Write a automation test case to create a new account in NPU online application
//@Ignore
@Test
public void testCreateNPUNewAccount() throws Exception {
// 1. Google search NPU, open NPU home page by clicking the google search result Northwestern Polytechnic University link
// 2. Select and open Online Application
// 3. Click Register Account link to open Create a New Account
// 4. Verify text "* Passwords are required to be a minimum of 6 characters in length." is displaying at the page
// 5. Verify the default radio button should select in New Applicant, select it if has not selected
// 6. Enter First Name
// 7. Enter Last Name
// 8. Verify Gender selection list default value is "Please Select"
// 9. Select Gender
// 10. Enter Email Address
// 11. Enter a invalid password or leave Confirm password empty
// 12. Click Save button, check warning message(s)
// 13. Go back to NPU home page
// 14. Close window
Thread.sleep(3000);
driver.quit();
}
Explanation / Answer
Answer:
import java.net.MalformedURLException;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
// ...
try
{
URL url = new URL("http://www.npu.com/atom.xml");
BufferedReader r1 = new BufferedReader(new InputStreamReader(url.openStream()));
String l1;
while ((l1 = r1.readLine()) != null)
{
}
r1.close();
}
catch (MalformedURLException e)
{
}
catch (IOException e)
{
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.