Forum Discussion

m_essaid's avatar
m_essaid
Valued Contributor
4 years ago

QuerySelector and multiple parameters

Hi,

I'm trying to automate a webpage essentially with QuerySelector.

I have a problem with a webpage that opens a popup : I have the same field in the main page than in the popup.

The popup had a the following div :

<div id="windowPopup>

And it contains the duplicated field which I have the following property :

data-bind="value: sSurname"

 

I need to use a combination of theses 2 properties to enter text on the right field.

 

Is it possible ? What could be the syntax please ?

Any help would be much appreciated,

  • Hi,

     

    What is the result of the execution of your code?

    Try to replace .Click() with .click(). (Small initial 'c') Does it help?

     

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    I finaly figured it out !

    I just have to use this syntax :

    page.QuerySelector(string).QuerySelector(string).Key()

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi all,

    I still have some issues with multiple selectors.

    For example, I would like to click on the anchor-square that is in the "menu-anchor-4" :

     

    I tried this :

    Sys.Browser('edge').Page(Pagexxx).QuerySelector('#menu-anchor-4]').QuerySelector('[class="anchor-square"]').Click();

     

    I think that I'm wrong while trying to select the id property of the li markup.

     

    Anyone could help please ? Thank you !

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      Hi,

       

      What is the result of the execution of your code?

      Try to replace .Click() with .click(). (Small initial 'c') Does it help?