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

An error occurred while receiving xml: ERROR: null root node returned #84

Closed
mrjay59 opened this issue Nov 10, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@mrjay59
Copy link

mrjay59 commented Nov 10, 2023

Describe the bug

I always find this bug when searching for elements

Dim Elspgsuara = Adb.FindElement("//node[@text='Mulai panggilan suara?']") 

for the device
image

how to solve it if node is null

Steps to reproduce the bug

Dim elEndC = Adb.FindElement($"//node[@resource-id='com.{whatsapp}:id/footer_end_call_btn']")
If (elEndC Is Nothing) Then
    Dim Elspgsuara = Adb.FindElement("//node[@text='Mulai panggilan suara?']") 'bar ic VOICE

    If Not (Elspgsuara Is Nothing) Then
        Thread.Sleep(500)
        KlikTouch("PAG", whatsapp)
    End If

    Dim Elstpaggil = Adb.FindElement("//node[@text='Pilih tipe panggilan']") 'bar ic VOICE

    If Not (Elstpaggil Is Nothing) Then
        Thread.Sleep(500)
        KlikTouch("PS1", whatsapp)
    End If
End If

Expected behavior

No response

Screenshots

No response

NuGet package version

Latest Source

.NET Platform

.NET Framework 4.5.x

Platform type

Windows

System version

windows 10

IDE

Visual Studio 2015

Additional context

No response

@mrjay59 mrjay59 added the bug Something isn't working label Nov 10, 2023
@wherewhere
Copy link
Member

@yungd1plomat

@yungd1plomat
Copy link
Member

yungd1plomat commented Nov 11, 2023

There could be many reasons. Please provide xml from the DumpScreenString method:

var client = new AdbClient();
var device = client.GetDevices().First();
var screen = client.DumpScreenString(device);
await File.WriteAllTextAsync("node.xml", screen);

@mrjay59
Copy link
Author

mrjay59 commented Nov 12, 2023

oke sir

@mrjay59 mrjay59 closed this as completed Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants