Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYCYh-0006Lx-Om for pgadmin-hackers@arkaria.postgresql.org; Wed, 27 Jun 2018 15:40:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fYCYf-0002jy-UZ for pgadmin-hackers@arkaria.postgresql.org; Wed, 27 Jun 2018 15:40:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fYCYf-0002jr-He for pgadmin-hackers@lists.postgresql.org; Wed, 27 Jun 2018 15:40:37 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fYCYY-0000Z8-4m for pgadmin-hackers@postgresql.org; Wed, 27 Jun 2018 15:40:36 +0000 Received: by mail-wm0-x243.google.com with SMTP id w137-v6so6384918wmw.1 for ; Wed, 27 Jun 2018 08:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eI8AYikkPrfMI40H4ZSs+V+A5imBoADEJpcevzi++Ls=; b=oc/8U55LXJicc8GFKenTPISs+4VAv95sI7iolLG+6ypRKCY7ekmxDHS+b7j7CIp0hD RrcR0Obgu+V7dIsZGJsXFC18A+wbb4gW53uofAST/Vree4uFG6D58J6jJDpw5zZTWRrc /vRBclNTkX12AnhXSaEoufwVDgXHWHLOjnpxO8pqEC6ui1FkOCzV0A2wQ1whSE0kqDkQ vwi3VPpEk77tMSLTT9t97rCPOfOHD4ZjbAqxnLyFOjf8z6vRihTlwdBm60knhByAsLbW nIPXa8Ff8fZ9vrwN9/UutzL0BSm5EUjjqVknOufcCilkyCB3Yo3hNvYyN0NOsjJUXYAE vwJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eI8AYikkPrfMI40H4ZSs+V+A5imBoADEJpcevzi++Ls=; b=p3ME6bqZWIHePgGYhHhsaFXjjXwDAnEeQyezXUdcoQm0jwOeBp7D5mVt6kVgdOPUO9 iD9nMrHD/DvtoK4eDdJwrKYK6HOU3bE4zW2XTfvjmTwDaDkWeoW1Qbm8u0w8GFXmMabS 3/SBiug7pylNWiGQ4hq/gACkiOCCFgpWZ90N+RxkjCRLIuM06Y3h7z27gcilAGtY5/vT 8NWxXJSB88Ef9+S9rTtywTAhMgSDWPrmU/O0TZSBAZynTLsN203d0T9rOpdzflW+CBly SwojZ7CdiISM8uB4dvILfh9YsnzBjnpaH+4ix1A2D4cFGHQvcKCCi9M6ASdyoCS9JOGe hEdA== X-Gm-Message-State: APt69E2kdsy1Y/FQK5KQ1kI7HaEoSKOZDFW99frRVLqnIKqUbIlGGorJ i2P+vmIbmbbUUA9mE4PHMDQ/8t0MtBpT9fD2uXzJJA== X-Google-Smtp-Source: AAOMgpcsjE2u18tSVsQ4IP6kqeKN42XYOBkUIfFUcWBtxPAtgqZqDwG+9bYsVEdvtxTFJGCCIfw2i8OEtGzlpPAYGV0= X-Received: by 2002:a1c:94f:: with SMTP id 76-v6mr5451111wmj.86.1530114028713; Wed, 27 Jun 2018 08:40:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:2907:0:0:0:0:0 with HTTP; Wed, 27 Jun 2018 08:40:28 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Wed, 27 Jun 2018 16:40:28 +0100 Message-ID: Subject: Re: pgadmin_page functions updated To: Shubham Agarwal Cc: Khushboo Vashi , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000025cadc056fa16ffa" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000025cadc056fa16ffa Content-Type: text/plain; charset="UTF-8" On Tue, Jun 26, 2018 at 8:45 AM, Shubham Agarwal < shubham.agarwal@enterprisedb.com> wrote: > Hi Team, > > I have modified the patch and used CSS Selector in add_server() function. > Thanks, applied. > > I have also tried different approaches to eliminate XPATH in click_tab() > function but failed to do so due to following reasons-: > > 1. :contains() function doesnt work with CSS selector in selenium and > since in most of the anchor tags there is no specific attribute present by > which we can make the locator generic so that it can work for any tab. > > 2. Tried using link_text or partial_link_text locators but since > click_tab() is a generic function which can click on any of the provided > tab name and in our case we do not have every tab having href attribute, we > have span tag as the tab as well (ex. Query tool tab) so link_text is not > the right option for it since it work only with the href attribute or > anchor tag. > > I found that in such cases XPATH is the only option to continue with. > > If anybody is having some another idea to achieve this using CSS Selector > than please suggest. > > Thanks and Regards, > Shubham Agarwal > > On Fri, Jun 15, 2018 at 4:11 AM, Dave Page wrote: > >> >> >> On Fri, Jun 15, 2018 at 6:32 AM, Khushboo Vashi < >> khushboo.vashi@enterprisedb.com> wrote: >> >>> Hi Shubham, >>> >>> On Thu, Jun 14, 2018 at 3:25 PM, Shubham Agarwal < >>> shubham.agarwal@enterprisedb.com> wrote: >>> >>>> Hi Team, >>>> >>>> I have modified following two functions in pgadmin_page.py :- >>>> >>>> 1. click_tab() -> Added wait till element is clickable, test cases are >>>> failing since the function attempts to click the tab which is not yet in >>>> the state to be clicked. >>>> >>>> 2. add_server() -> Replaced the sleep statement with wait till element >>>> to be clickable. >>>> >>>> Please find the attached patch. >>>> >>>> We should start using CSS selectors instead of xpath, otherwise the >>> patch works fine and also changes look good to me. >>> >> >> Yes, and we should update files as and when we touch them as part of our >> ongoing refactoring. >> >> Shubham; please go through the files your patch touches, and replace any >> xpath selectors with CSS selectors. Aside from that, the patch looked to >> me too, and Pivotal's patch-bot seems happy with it. >> >> Thanks. >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > > > > -- > Thanks & Regards, > Shubham Agarwal > EnterpriseDB Corporation > > The Postgres Database Company > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --00000000000025cadc056fa16ffa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Jun 26, 2018 at 8:45 AM, Shubham Agarwal <= shubh= am.agarwal@enterprisedb.com> wrote:
Hi Team,

I have modified the p= atch and used CSS Selector in add_server() function.

Thanks, applied.
=C2=A0

I have also tried dif= ferent approaches to eliminate XPATH in click_tab() function but failed to = do so due to following reasons-:=C2=A0

=C2=A0 =C2= =A01. :contains() function doesnt work with CSS selector in selenium and si= nce in most of the anchor tags there is no specific attribute present by wh= ich we can make the locator generic so that it can work for any tab.
<= div>
=C2=A0 =C2=A02. Tried using link_text or partial_link_te= xt locators but since click_tab() is a generic function which can click on = any of the provided tab name and in our case we do not have every tab havin= g href attribute, we have span tag as the tab as well (ex. Query tool tab) = so link_text is not the right option for it since it work only with the hre= f attribute or anchor tag.

I found that in such ca= ses XPATH is the only option to continue with.

If = anybody is having some another idea to achieve this using CSS Selector than= please suggest.

Thanks and Regards,
Shu= bham Agarwal
<= br>
On Fri, Jun 15, 2018 at 4:11 AM, Dave Page <= dpage@pgadmin.org> wrote:
<= div dir=3D"ltr">

On Fri, Jun 15, 2018 at 6:32 AM, Khushboo Vashi = <kh= ushboo.vashi@enterprisedb.com> wrote:
Hi Shubham,
=
On Thu, Jun 14, 2018 at 3:25 PM, Shubh= am Agarwal <shubham.agarwal@enterprisedb.com> wrote:
Hi Team,
I have modified following two functions in pgadmin_page.py= :-

1. click_tab() -> Added wait till element i= s clickable, test cases are failing since the function attempts to click th= e tab which is not yet in the state to be clicked.

2. add_server() -> Replaced the sleep statement with wait till element = to be clickable.=C2=A0

Please find the attached pa= tch.

<= /font>
We should start using CSS= selectors instead of xpath, otherwise the patch works fine and also change= s look good to me.

Yes, and we should update files as and when we touch them as part of= our ongoing refactoring.

Shubham; please go throu= gh the files your patch touches, and replace any xpath selectors with CSS s= electors.=C2=A0 Aside from that, the patch looked to me too, and Pivotal= 9;s patch-bot seems happy with it.

Thanks.
--
Dave Page
Blog: <= a href=3D"http://pgsnake.blogspot.com" target=3D"_blank">http://pgsnake.blo= gspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.comThe Enterprise PostgreSQL Company



--
Thanks & Regards,
Shubh= am Agarwal
EnterpriseDB Corporation

The Postgres Database Company



--
Dave Page
Blog: = http://pgsnake.bl= ogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com<= br>The Enterprise PostgreSQL Company
--00000000000025cadc056fa16ffa--