jeudi 21 mai 2015

In selenium web driver,I can able to click the save button then page getting saved but it shows no such element error message not able to go futher

To check Fifth Tab */

        boolean fifth_a=driver.findElement(By.xpath("//*[@id='RadTabStrip2']/div/ul/li[5]/a/span/span/span")).isDisplayed();
        boolean fifth_b=driver.findElement(By.xpath("//*[@id='RadTabStrip2']/div/ul/li[5]/a/span/span/span")).isEnabled();
      String Depression5="";
      if(fifth_a==true && fifth_b==true)
      {
      driver.findElement(By.xpath("//*[@id='RadTabStrip2']/div/ul/li[5]/a/span/span/span")).click();
      Thread.sleep(3000);
      WebElement text5=driver.findElement(By.xpath("//*[@id='RadTabStrip2']/div/ul/li[5]/a/span/span"));
      Depression5=text5.getText();
      }
      else
      {
          System.out.println("No tabs");
      }
      if(Depression5.equals("Depression"))
      {
      driver.switchTo().defaultContent();
      driver.switchTo().frame("ctl00_C5POBody_EncounterContainer");
      driver.switchTo().frame(driver.findElement(By.xpath("//*[@id='pageViewEncounter']/iframe")));

      driver.switchTo().frame(driver.findElement(By.xpath("//*[@id='RadPageView1']/iframe")));

      save(driver);
      } 

      else
      {
         System.out.println("Opened window is not depression");
      }

  /* End of Fifth tab check */}

public void save(WebDriverdriver)throws InterruptedException,NoSuchElementException
      {

      driver.findElement(By.xpath("//*[@id='rdbtn Not At All Little interest or pleasure in doing things-Depression-0']")).click();
      Thread.sleep(1000);
      driver.findElement(By.xpath("//*[@id='DLCLittle interest or pleasure in doing things-Depression-0_txtDLC']")).sendKeys("pleasure in doing things-Depression");
      Thread.sleep(1000);
      driver.findElement(By.xpath("//*[@id='rdbtn Nearly Every Day Feeling down, depressed, or hopeless-Depression-1']")).click();
      Thread.sleep(1000);

        driver.findElement(By.id("btnSave")).click();
        Thread.sleep(3000);
        return;
     }

In selenium web driver,I can able to click the save button and when driver try to execute the next line, it shows error as No such element. I tried more things but can able to clear this issue. Please check the error message.

                  org.openqa.selenium.NoSuchElementException: no such element
                (Session info: chrome=43.0.2357.65)
                (Driver info: chromedriver=2.15.322448
  (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Windows NT 6.1 SP1 x86) (WARNING: The server did not provide any stacktrace information)
 Command duration or timeout: 1.06 seconds
 For documentation on this error, please visit:  

http://ift.tt/1c3pd29
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'ACURUS154', ip: '172.18.1.111', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={userDataDir=C:\Users\kannank\AppData\Local\Temp\scoped_dir912_9689}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=43.0.2357.65, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 8c312dccc74442e2a744c7b03d5ccf28
Command duration or timeout: 1.51 seconds
For documentation on this error, please visit:        

http://ift.tt/1c3pd29
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome=     {userDataDir=C:\Users\kannank\AppData\Local\Temp\scoped_dir912_9689}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=43.0.2357.65, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, webdriver.remote.sessionid=30794df9-bc88-439e-825d-11dff1e33c7b, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
   Session ID: 30794df9-bc88-439e-825d-11dff1e33c7b

Aucun commentaire:

Enregistrer un commentaire