Forum Discussion

Mike_Martin's avatar
Mike_Martin
New Contributor
3 years ago

Web page need to scroll to see an element

I have an element

page.FindElement(".ag-body-horizontal-scroll-viewport")

I need to drag it until 

(//div [@col-id='XePatientVisit.WorkID.XeWorkflowInstanceState.0.WorkState' ])[2]

shows up. 

 

There are different entries so the length keeps changing. 

 

Also changes if I use a  bigger screen.

2 Replies

  • Mike_Martin's avatar
    Mike_Martin
    New Contributor

    Sorry I should have been more specific.

    I want to do a while loop to scroll this page.FindElement(".ag-body-horizontal-scroll-viewport") until this is present. I set it to continue on errors but I get 

    Unable to find the object "(//div [@col-id='XePatientVisit.WorkID.XeWorkflowInstanceState.0.WorkState'])[2] ". See Details for additional information.

    If I have a bigger screen it fails to find the object.

    I have it set to continue on errors so why am I getting an error

     

    while Project.Variables.queue == 'blank':

        x=100+100
        page.panel19.Drag(x, 5, 86, 3) or  I try page.panel19.Click()

        Project.Variables.queue= page.FindElement("(//div [@col-      id='XePatientVisit.WorkID.XeWorkflowInstanceState.0.WorkState'])[2] ").contentText