Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getScreenshot ().copy sometimes doesnt't work #18

Open
GoogleCodeExporter opened this issue Mar 31, 2015 · 8 comments
Open

getScreenshot ().copy sometimes doesnt't work #18

GoogleCodeExporter opened this issue Mar 31, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

Operating system : Windows XP SP2
.Net Framework version : 3.5
Office Version : 2010
SeleniumWrapper version : 1.0.10

What is your issue ?
Most of the times the "getScreenshot().copy" Function works very fine. But in 
some cases there is no Screenshot I can`t tell you when its seems randomly. Is 
there something I could look for? Its really important for me and its a pity 
that this getScreenshot doesn't work everytime.
Your example on your Page always works fine even on my PC :-)


Original issue reported on code.google.com by [email protected] on 19 Mar 2013 at 2:17

@GoogleCodeExporter
Copy link
Author

Maby the rendering is not finished when the copy command is executed.
Try to wait a bit longer before each copy :
   selenium.wait 2000
   selenium.getScreenshot().copy

Have you tried with other browsers ?

Original comment by florentbr on 20 Mar 2013 at 4:53

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Hi...
Now I realised that this Problem only occure when I use the getScreenshot in a 
function from another function.
example: 

Private Sub TestSub(Zeile As Integer)

(normal selenium Test which works fine)

Screenshot

End Sub

Private Function Screenshot()

Dim selenium As New SeleniumWrapper.WebDriver

            'Mache einen Screenshot
            selenium.Wait 1000
            selenium.getScreenshot().Copy

            'Speichere Screenshot auf ReportSeite
            Sheets(6).Range("A10").PasteSpecial

End Function

====

Original comment by [email protected] on 21 Mar 2013 at 8:27

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

When I switch of the "on error resume next" I get the message "Ungültiger 
Zeiger" (Invalid Pointer on English) ...
I can't understand it because the selenium.wait works without Problem

Original comment by [email protected] on 21 Mar 2013 at 9:54

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Your probably get this error because you forgot the "open" command in your 
example.
If it doesn't solve your problem, please provide a full example using a public 
website that will reproduce the issue.

Original comment by florentbr on 21 Mar 2013 at 1:14

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

In the Exampel the "Open" Comman is in the Sub "TestSub"

Original comment by [email protected] on 22 Mar 2013 at 1:51

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

In your Screenshoot function, you are creating a new browser instance (New 
SeleniumWrapper.WebDriver) without using the open command, which leads on a 
failure on the getScreenshoot as there is no webpage.

The rigth syntax is :

Private Sub TestSub(Zeile As Integer)
    Dim selenium As New SeleniumWrapper.WebDriver
    (normal selenium Test which works fine)
    Screenshot selenium
End Sub

Private Function Screenshot(Byref selenium as SeleniumWrapper.WebDriver)
    'Mache einen Screenshot
    selenium.Wait 1000
    selenium.getScreenshot().Copy
    'Speichere Screenshot auf ReportSeite
    Sheets(6).Range("A10").PasteSpecial
End Function

Original comment by florentbr on 22 Mar 2013 at 2:21

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Perfect ;-) Thank you very much!

Original comment by [email protected] on 22 Mar 2013 at 3:15

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by florentbr on 25 Mar 2013 at 12:07

  • Changed state: Done
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant