Hi,
I have recorded one scenario by using slenium
IDE, it is working fine while executing the same scenario by using selenium IDE. But while executing the testcases as Junit4(webdriver) and Junit4(Backed selenium) its getting failed to get the frames. Can anyone suggest to solve the problem.
TC which is exported as BackedSelenium:
@Test
public void testManagerSelenium() throws Exception {
selenium.open("http://10.4.177.248:9866/prweb/PRServlet");
selenium.type("id=txtUserID", "manager@virtusa.com");
selenium.type("id=txtPassword", "rules");
selenium.click("name=pyActivity=Code-Security.Login");
selenium.waitForPageToLoad("30000");
selenium.click("css=#Tab2 > #ACCORANCHOR > #TABSPAN > #RULE_KEY > tbody > tr > td.accord_titleBarBackground");
selenium.selectFrame("PWGadget0Ifr");
selenium.click("//table[@id='ViewTable']/tbody/tr[7]/td[3]");
selenium.waitForPageToLoad("10000");
//--
Unable to find this below frames
selenium.selectFrame("relative=up");
selenium.selectFrame("PWGadget1Ifr");
selenium.select("id=ManagerApprovalLatest", "label=Approve");
selenium.type("id=ManagerComments", "enter value for the reason");
selenium.click("id=submitButton");
selenium.waitForPageToLoad("30000");
}
TC which is exportedAs Junit4(Webdirver):
@Test
public void testManagerDriver() throws Exception {
driver.get(baseUrl + "/prweb/PRServlet/oO9O9iMscyJc_fy6LnBDXO9xEtRpDxfL3At36r8Aw8k%5B*/!STANDARD?");
driver.findElement(By.id("txtUserID")).clear();
driver.findElement(By.id("txtUserID")).sendKeys("manager");
driver.findElement(By.id("txtPassword")).clear();
driver.findElement(By.id("txtPassword")).sendKeys("rules");
driver.findElement(By.name("pyActivity=Code-Security.Login")).click();
driver.findElement(By.cssSelector("#Tab2 > #ACCORANCHOR > #TABSPAN > #RULE_KEY > tbody > tr > td.accord_titleBarBackground")).click();
//----
Unable to find the below Frame
// ERROR: Caught exception [ERROR: Unsupported command [selectFrame]]
driver.findElement(By.xpath("//table[@id='ViewTable']/tbody/tr[9]/td[3]")).click();
//----
Unable to find the below Frames
// ERROR: Caught exception [ERROR: Unsupported command [selectFrame]]
// ERROR: Caught exception [ERROR: Unsupported command [selectFrame]]
new Select(driver.findElement(By.id("ManagerApprovalLatest"))).selectByVisibleText("Approve");
driver.findElement(By.id("ManagerComments")).clear();
driver.findElement(By.id("ManagerComments")).sendKeys("enter value for the reason");
driver.findElement(By.id("submitButton")).click();
}
Thanks & Regards,
Lekkal